Load Libraries

suppressMessages(library(minfi))
suppressMessages(library(reshape))
suppressMessages(library(ggplot2))
suppressMessages(library(gridExtra))
suppressMessages(library(RColorBrewer))
suppressMessages(library(here))
suppressMessages(library(binom))
suppressMessages(library(limma))

options(stringsAsFactors = FALSE)

Load Functions

source(here("scripts","00_pretty_plots.R"))
suppressMessages(source(here("scripts","00_heat_scree_plot_generic.R")))
source(here("scripts","00_EM_array_uniform_background.R"))
## Loading required package: splines

Download Data

# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.1.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.2.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.3.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.4.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.5.zip
# unzip E-MTAB-4957.raw.1.zip 
# unzip E-MTAB-4957.raw.2.zip 
# unzip E-MTAB-4957.raw.3.zip 
# unzip E-MTAB-4957.raw.4.zip 
# unzip E-MTAB-4957.raw.5.zip 

#wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.sdrf.txt
path<-"data/published_organoids/E_MTAB_4957"

sampleinfo_organoid <- read.table(here(path, "E-MTAB-4957.sdrf.txt"), header=T, sep="\t")
sampleinfo_organoid<-sampleinfo_organoid[,c(1:15,30:34,38:41)]

#sample info cleanup
sampleinfo_organoid$sentrix<-sapply(1:nrow(sampleinfo_organoid), function(x) strsplit(as.character(sampleinfo_organoid$Assay.Name)[x], "_")[[1]][1])

sampleinfo_organoid$array.id.path <- file.path(here(path), sampleinfo_organoid$Assay.Name)
rgset_organoid <- read.metharray(sampleinfo_organoid$array.id.path, verbose = FALSE)

Normalize DNAm Arrays

# Background and dye bias correction with noob thhrough funnorm implemented in minfi
#http://bioconductor.org/help/course-materials/2015/BioC2015/methylation450k.html
MSet.illumina <- preprocessFunnorm(rgset_organoid)
## [preprocessFunnorm] Background and dye bias correction with noob
## Loading required package: IlluminaHumanMethylation450kmanifest
## Loading required package: IlluminaHumanMethylation450kanno.ilmn12.hg19
## 
## Attaching package: 'IlluminaHumanMethylation450kanno.ilmn12.hg19'
## The following objects are masked from 'package:IlluminaHumanMethylationEPICanno.ilm10b4.hg19':
## 
##     Islands.UCSC, Locations, Manifest, Other,
##     SNPs.132CommonSingle, SNPs.135CommonSingle,
##     SNPs.137CommonSingle, SNPs.138CommonSingle,
##     SNPs.141CommonSingle, SNPs.142CommonSingle,
##     SNPs.144CommonSingle, SNPs.146CommonSingle,
##     SNPs.147CommonSingle, SNPs.Illumina
## [preprocessFunnorm] Mapping to genome
## [preprocessFunnorm] Quantile extraction
## [preprocessFunnorm] Normalization
MTAB_organoid_beta<-getBeta(MSet.illumina)

Detection p values across all probes for each sample

avg_detPval <- colMeans(detectionP(rgset_organoid))
sampleinfo_organoid$det_pval<-avg_detPval

print("detection pval")
## [1] "detection pval"
ggplot(sampleinfo_organoid)+geom_boxplot(aes(as.factor(sentrix), det_pval, fill=as.factor(sentrix)), outlier.shape = NA)+
  geom_point(aes(as.factor(sentrix), det_pval, group=Assay.Name, fill=as.factor(sentrix)), shape=21, color="black",
             position = position_jitter(w = 0.25))+theme_bw()+theme(axis.text.x=element_text(angle = 45, vjust = 1, hjust=1))+
  xlab("Sentrix ID")+ylab("Mean Detection P Value")+guides(fill=FALSE)+ylim(0,0.008)

ggsave(here("figs","MTAB4957_detection_pvalue.pdf"), width=6, height=5)
ggsave(here("figs/jpeg","MTAB4957_detection_pvalue.jpeg"), width=6, height=5)

Beta distribution before and after normalization

beta_raw<-getBeta(rgset_organoid)
betas<-getBeta(MSet.illumina)

Beta_melted<- melt(betas)
Beta_melted_raw<- melt(beta_raw)

#remove NAs before plotting (otherwise get many non-inifnite warnings)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
Beta_Plot_raw<-Beta_melted_raw[which(!(is.na(Beta_melted_raw$value))),]

#add meta
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,sampleinfo_organoid, by.x="ID", by.y="Assay.Name")
colnames(Beta_Plot_raw)<-c("CpG","ID","Beta")
Beta_Plot_raw<-merge(Beta_Plot_raw,sampleinfo_organoid, by.x="ID", by.y="Assay.Name")

dis1<-ggplot(Beta_Plot, aes(Beta, group=as.character(ID), color=as.character(Characteristics.sampling.site.)))+
  geom_density()+theme_bw()+xlab("DNAm Beta Value")

dis2<-ggplot(Beta_Plot_raw, aes(Beta, group=as.character(ID), color=as.character(Characteristics.sampling.site.)))+
  geom_density()+theme_bw()+xlab("DNAm Beta Value")

ggsave(here("figs","MTAB4957_beta_distribution.pdf"), grid.arrange(dis1, dis2),w=20, h=5)
ggsave(here("figs/jpeg","MTAB4957_beta_distribution.jpeg"), grid.arrange(dis1, dis2), w=20, h=5)

Probe Filtering

MTAB_organoid_beta <- MTAB_organoid_beta[!grepl("rs",rownames(MTAB_organoid_beta)), ]
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 485512"

450K annotation from illumina

# https://emea.support.illumina.com/downloads/humanmethylation450_15017482_v1-2_product_files.html
anno_450k<-read.csv(here("data","HumanMethylation450_15017482_v1-2.csv"), skip=7)
anno_450k<-anno_450k[match(rownames(MTAB_organoid_beta),anno_450k$IlmnID),]
identical(rownames(MTAB_organoid_beta), anno_450k$IlmnID)
## [1] TRUE

Sex Chromosomes

MTAB_organoid_beta<-MTAB_organoid_beta[which(!(anno_450k$CHR%in%c('X','Y'))),] 
filt_sex<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"Probes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134Probes available: 473864"

Cross-hybridizing probes and polymorphic probes.

Some probes have been found to cross-hybridize with other chromosomes (Price et al. 2013 Epigenetics). https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GPL16304

price<-read.table(here("data","GPL16304-47833.txt"), sep='\t', header=T, skip=22)
price<-price[match(rownames(MTAB_organoid_beta),price$ID),]

cross_hyb<-price[which(price$XY_Hits=="XY_YES" | price$Autosomal_Hits=="A_YES"),]
MTAB_organoid_beta<-MTAB_organoid_beta[which(!(rownames(MTAB_organoid_beta)%in%cross_hyb$ID)),]
filt_cross<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 433274"

Polymorphic probes

SnpatCpG<-price[which(price$Target.CpG.SNP!=""),]
MTAB_organoid_beta<-MTAB_organoid_beta[which(!(rownames(MTAB_organoid_beta)%in%SnpatCpG$ID)),]
filt_poly<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 415080"

Probe filtering based on detection pvalue and detection over background (NA)

Remove probes with high NA count

na_count_probe <-sapply(1:nrow(MTAB_organoid_beta), function(y) length(which(is.na(MTAB_organoid_beta[y,]))))
na_count_probe_good<-which(na_count_probe<(ncol(MTAB_organoid_beta)*0.05))
MTAB_organoid_beta<-MTAB_organoid_beta[na_count_probe_good,]
filt_bead<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 415080"

Remove probes with high detection p value across samples, and any samples with many high detection p value probes

detP <- detectionP(rgset_organoid)
failed <- detP>0.05
bad_det_p<-names(which(rowMeans(failed)>0.01))
bad_det_psamp<-names(which(colMeans(failed)>0.01))

MTAB_organoid_beta<-MTAB_organoid_beta[which(!(rownames(MTAB_organoid_beta)%in%bad_det_p)),]
MTAB_organoid_beta<-MTAB_organoid_beta[,which(!(colnames(MTAB_organoid_beta)%in%bad_det_psamp))]

filt_detp<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 409528"

Tidy meta data available

sampleinfo_organoid<-sampleinfo_organoid[,c(1:16,24:27)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE
head(sampleinfo_organoid)
##   Source.Name Material.Type Characteristics.organism.
## 1          P1 organism part              Homo sapiens
## 2          P2 organism part              Homo sapiens
## 3          P3 organism part              Homo sapiens
## 4          P4 organism part              Homo sapiens
## 5          P5 organism part              Homo sapiens
## 6          P6 organism part              Homo sapiens
##   Characteristics.individual. Characteristics.cell.type.
## 1                          P1              organism part
## 2                          P2              organism part
## 3                          P3              organism part
## 4                          P4              organism part
## 5                          P5              organism part
## 6                          P6              organism part
##   Characteristics.biosource.type. Characteristics.developmental.stage.
## 1                   organism part                       juvenile stage
## 2                   organism part                       juvenile stage
## 3                   organism part                       juvenile stage
## 4                   organism part                       juvenile stage
## 5                   organism part                       juvenile stage
## 6                   organism part                       juvenile stage
##   Characteristics.sampling.site. Characteristics.age. Unit.time.unit.
## 1                  sigmoid colon              5 to 15            year
## 2                  sigmoid colon              5 to 15            year
## 3                  sigmoid colon              6 to 15            year
## 4                  sigmoid colon              7 to 15            year
## 5                  sigmoid colon              8 to 15            year
## 6                  sigmoid colon              9 to 15            year
##   Term.Source.REF Term.Accession.Number Characteristics.sex.
## 1             EFO            UO_0000036               female
## 2             EFO            UO_0000036                 male
## 3             EFO            UO_0000036                 male
## 4             EFO            UO_0000036                 male
## 5             EFO            UO_0000036                 male
## 6             EFO            UO_0000036                 male
##   Characteristics.passage. Comment..basename.        Assay.Name
## 1           not applicable  5831583005_R01C01 5831583005_R01C01
## 2           not applicable  5831583005_R02C01 5831583005_R02C01
## 3           not applicable  5831583005_R03C01 5831583005_R03C01
## 4           not applicable  5831583005_R04C01 5831583005_R04C01
## 5           not applicable  5831583005_R05C01 5831583005_R05C01
## 6           not applicable  5831583005_R06C01 5831583005_R06C01
##   Factor.Value..block.    sentrix
## 1                    5 5831583005
## 2                    5 5831583005
## 3                    5 5831583005
## 4                    5 5831583005
## 5                    5 5831583005
## 6                    5 5831583005
##                                                                                                array.id.path
## 1 /nfs/research1/zerbino/redgar/organoid_passage_DNAm/data/published_organoids/E_MTAB_4957/5831583005_R01C01
## 2 /nfs/research1/zerbino/redgar/organoid_passage_DNAm/data/published_organoids/E_MTAB_4957/5831583005_R02C01
## 3 /nfs/research1/zerbino/redgar/organoid_passage_DNAm/data/published_organoids/E_MTAB_4957/5831583005_R03C01
## 4 /nfs/research1/zerbino/redgar/organoid_passage_DNAm/data/published_organoids/E_MTAB_4957/5831583005_R04C01
## 5 /nfs/research1/zerbino/redgar/organoid_passage_DNAm/data/published_organoids/E_MTAB_4957/5831583005_R05C01
## 6 /nfs/research1/zerbino/redgar/organoid_passage_DNAm/data/published_organoids/E_MTAB_4957/5831583005_R06C01
##       det_pval
## 1 0.0009280434
## 2 0.0002483935
## 3 0.0003242456
## 4 0.0002260101
## 5 0.0002923051
## 6 0.0004080649

Seperate out primary pediatric samples

sampleinfo_ped_primary<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.developmental.stage.=="juvenile stage" & sampleinfo_organoid$Characteristics.biosource.type.=="purified cell"),]
print(paste("Primary pediatric samples available: ",nrow(sampleinfo_ped_primary), sep=""))
## [1] "Primary pediatric samples available: 35"
# Three samples are the non-epithelial portion
sampleinfo_ped_primary<-sampleinfo_ped_primary[-grep("non-epithelial",sampleinfo_ped_primary$Characteristics.cell.type.),]
organoid_ped_primary<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_ped_primary$Assay.Name)]
identical(colnames(organoid_ped_primary),sampleinfo_ped_primary$Assay.Name)
## [1] TRUE
print(paste("Primary samples available: ",nrow(sampleinfo_ped_primary), sep=""))
## [1] "Primary samples available: 32"

Seperate out primary fetal samples

sampleinfo_fetal_primary<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.developmental.stage.=="fetal stage" & sampleinfo_organoid$Characteristics.biosource.type.=="purified cell"),]
print(paste("Primary fetal samples available: ",nrow(sampleinfo_fetal_primary), sep=""))
## [1] "Primary fetal samples available: 11"
organoid_fetal_primary<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_fetal_primary$Assay.Name)]
identical(colnames(organoid_fetal_primary),sampleinfo_fetal_primary$Assay.Name)
## [1] TRUE
print(paste("Primary samples available: ",nrow(sampleinfo_fetal_primary), sep=""))
## [1] "Primary samples available: 11"

Only organoids

sampleinfo_organoid<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.biosource.type.=="organoid"),]
MTAB_organoid_beta<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid$Assay.Name)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE
print(paste("Organoid samples available: ",nrow(sampleinfo_organoid), sep=""))
## [1] "Organoid samples available: 82"

Numeric passage

sampleinfo_organoid$passage.or.rescope.no_numeric<-as.factor(as.character(sampleinfo_organoid$Characteristics.passage.))
levels(sampleinfo_organoid$passage.or.rescope.no_numeric)<-c(1,11,12,14,18,2,21,23,3,4,5,6,7,8,9)
sampleinfo_organoid$passage.or.rescope.no_numeric<-as.numeric(as.character(sampleinfo_organoid$passage.or.rescope.no_numeric))

sample_ID to include patient and tissue

sampleinfo_organoid$sample_ID<-paste(sampleinfo_organoid$Characteristics.individual., sampleinfo_organoid$Characteristics.sampling.site.)

Extracting information from source name and associated paper

remove AP as it seems to indicate a mixture of passages (i.e P1AP6)? These aen’t mentioned in manscript?

sampleinfo_organoid<-sampleinfo_organoid[-grep("AP",sampleinfo_organoid$Source.Name),]

Unclear what GM and IM are but it seems like only 281 was under these conditions, so will exclude to be safe

sampleinfo_organoid<-sampleinfo_organoid[-grep("281",sampleinfo_organoid$Source.Name),]

tidy condition

sampleinfo_organoid$condition<-NA

need to grep for WT and Clone B

sampleinfo_organoid$condition[grep("WT",sampleinfo_organoid$Source.Name)]<-"WT"
sampleinfo_organoid$condition[grep("Clone B|CloneB",sampleinfo_organoid$Source.Name)]<-"KO"

DM seems to be differenitated and SCM is maybe undifferentiated

sampleinfo_organoid$condition[grep("SCM",sampleinfo_organoid$Source.Name)]<-"SCM"
sampleinfo_organoid$condition[grep("DM",sampleinfo_organoid$Source.Name)]<-"DM4d"

print(paste("Organoid samples available: ",nrow(sampleinfo_organoid), sep=""))
## [1] "Organoid samples available: 70"
# match the DNAm data
MTAB_organoid_beta<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid$Assay.Name)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE
Filter samples later run in both dataset

Individuals “212” “223” “224” “225” “369” are in both studies. The organoids from these individuals will be removed from the differential DNAm analysis, but visulized later to show the patterns occur across array type Saving them for later integration

sampleinfo_organoid_paired<-sampleinfo_organoid[grep("212|223|224",sampleinfo_organoid$Characteristics.individual.),]
MTAB4957_beta_for_paird<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid_paired$Assay.Name)]
identical(colnames(MTAB4957_beta_for_paird), sampleinfo_organoid_paired$Assay.Name)
## [1] TRUE
print(paste("Organoid samples available: ",nrow(sampleinfo_organoid_paired), sep=""))
## [1] "Organoid samples available: 16"

load the EPIC organoids

load(here("data","beta_organoids.RData"))

intersect(sampleinfo_organoid$Characteristics.individual., epic.organoid$case.no)
## [1] "212" "223" "224" "225" "369"

369 and 225 are run at identical passages in both cohorts so all samples will be removed.

sampleinfo_organoid[grep("369",sampleinfo_organoid$Characteristics.individual.),c(1,4,8,9,13,21,22)]
##        Source.Name Characteristics.individual.
## 105  369 TI P3 SCM                         369
## 106 369 TI P3 DM4d                         369
## 108  369 SC P3 SCM                         369
## 110 369 SC P3 DM4d                         369
##     Characteristics.sampling.site. Characteristics.age.
## 105                 terminal ileum                    9
## 106                 terminal ileum                    9
## 108                  sigmoid colon                    9
## 110                  sigmoid colon                    9
##     Characteristics.sex. passage.or.rescope.no_numeric          sample_ID
## 105                 male                             3 369 terminal ileum
## 106                 male                             3 369 terminal ileum
## 108                 male                             3  369 sigmoid colon
## 110                 male                             3  369 sigmoid colon
epic.organoid[grep("369",epic.organoid$case.no),c(1,5,17, 9, 10)]
##    case.no sample.site passage.or.rescope.no_numeric sex age
## 22     369          SC                             3   M   9
## 23     369          TI                             3   M   9
sampleinfo_organoid<-sampleinfo_organoid[-grep("369|225",sampleinfo_organoid$Characteristics.individual.),]

212,223 and 224 have organoids at passages only used in MTAB-4957. So organoids that are included at the same passage will be removed.

remove_sampleID<-c("212 SC P6","212 TI P6","223 SC P2","223 TI P2","224 SC P3","224 TI P2")
sampleinfo_organoid<-sampleinfo_organoid[which(!(sampleinfo_organoid$Source.Name%in%remove_sampleID)),]

print(paste("Organoid samples available: ",nrow(sampleinfo_organoid), sep=""))
## [1] "Organoid samples available: 58"
# match the DNAm data
MTAB_organoid_beta<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid$Assay.Name)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE

Fetal, pedatric and adult organoids together

pca_res <- prcomp(t(MTAB_organoid_beta))
Loadings<-as.data.frame(pca_res$x)
vars <- pca_res$sdev^2
Importance<-vars/sum(vars)

meta_categorical <- sampleinfo_organoid[, c(4,7,8,13,17,18)]  # input column numbers in meta that contain categorical variables
meta_continuous <- sampleinfo_organoid[, c(9,21)]  # input column numbers in meta that contain continuous variables
colnames(meta_categorical) <- c("Individual", "Developmental Stage","Sample Site","Sex","Block","Sentrix ID")
colnames(meta_continuous) <- c("Age", "Passage")
meta_continuous$Age<-as.numeric(meta_continuous$Age)
meta_categorical$Block<-as.factor(meta_categorical$Block)


ord<-1:length(c(colnames(meta_categorical),colnames(meta_continuous)))
PCs_to_view<-10
suppressWarnings(heat_scree_plot(Loadings, Importance, 2.5, 2.7))

## PC vs PC plot
Loadings$Assay.Name<-rownames(Loadings)
Loadings_meta<-merge(Loadings, sampleinfo_organoid, by="Assay.Name")

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.developmental.stage.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab("PC1 (29%)")+ylab("PC2 (10%)")+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab("PC1 (29%)")+ylab("PC2 (10%)")+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

ggplot(Loadings_meta, aes(PC2, PC3, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
    xlab("PC2 (10%)")+ylab("PC3 (8%)")+th+theme(axis.text = element_text(size=12),
                                                 axis.title = element_text(size=14),
                                                 plot.margin = margin(1, 0.1, 1, 1, "cm"))

pc_plt<-ggplot(Loadings_meta, aes(PC2, PC3, fill=as.factor(passage.or.rescope.no_numeric),color=Characteristics.developmental.stage.))+geom_line(aes(PC2,PC3, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab("PC2 (10%)")+ylab("PC3 (8%)")+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

legend<-ggplot(sampleinfo_organoid, aes(as.factor(-passage.or.rescope.no_numeric), fill=as.factor(passage.or.rescope.no_numeric)))+geom_bar(color="black")+
  theme_bw()+theme(legend.position = "none", axis.text.y = element_blank(),
                   axis.title.y = element_blank(),
                   axis.ticks.y = element_blank(),
                   legend.title=element_text(size=10),
                   legend.text=element_text(size=8))+
  coord_flip()+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+th

r <- ggplot() + theme_void()

grid.arrange(pc_plt,arrangeGrob(r,legend,r, heights=c(0.6,1.25,0.4)), ncol=2, widths=c(7,1))

High passage fetal toward older organoids?

ggplot(Loadings_meta, aes(PC1, PC2, fill=as.factor(passage.or.rescope.no_numeric), color=Characteristics.developmental.stage.))+geom_line(aes(PC1,PC2, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab("PC2 (10%)")+ylab("PC3 (8%)")+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

Non Fetal samples

sampleinfo_organoid_notfetal<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.biosource.type.=="organoid" & sampleinfo_organoid$Characteristics.developmental.stage.!="fetal stage"),]
MTAB_organoid_beta_notfetal<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid_notfetal$Assay.Name)]
identical(colnames(MTAB_organoid_beta_notfetal),sampleinfo_organoid_notfetal$Assay.Name)
## [1] TRUE

PCA

pca_res <- prcomp(t(MTAB_organoid_beta_notfetal))
Loadings<-as.data.frame(pca_res$x)
vars <- pca_res$sdev^2
Importance<-vars/sum(vars)

meta_categorical <- sampleinfo_organoid_notfetal[, c(4,7,8,13,17,18)]  # input column numbers in meta that contain categorical variables
meta_continuous <- sampleinfo_organoid_notfetal[, c(9,21)]  # input column numbers in meta that contain continuous variables
colnames(meta_categorical) <- c("Individual", "Developmental Stage","Sample Site","Sex","Block","Sentrix ID")
colnames(meta_continuous) <- c("Age", "Passage")
meta_continuous$Age<-as.numeric(meta_continuous$Age)
meta_categorical$Block<-as.factor(meta_categorical$Block)

ord<-1:length(c(colnames(meta_categorical),colnames(meta_continuous)))
PCs_to_view<-10
suppressWarnings(heat_scree_plot(Loadings, Importance, 2.5, 2.7))

## PC vs PC plot
Loadings$Assay.Name<-rownames(Loadings)
Loadings_meta<-merge(Loadings, sampleinfo_organoid_notfetal, by="Assay.Name")

Sample Site

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab("PC1 (19%)")+ylab("PC2 (13%)")+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

Condition

ggplot(Loadings_meta, aes(PC1, PC2, fill=condition))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab("PC1 (19%)")+ylab("PC2 (13%)")+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

Sample Site PC2/3

ggplot(Loadings_meta, aes(PC2, PC3, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab("PC2 (13%)")+ylab("PC3 (10%)")+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

Sample Site PC3/4

ggplot(Loadings_meta, aes(PC3, PC4, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab("PC3 (10%)")+ylab("PC4 (6%)")+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

pc_plt<-ggplot(Loadings_meta, aes(PC2, PC3, fill=as.factor(passage.or.rescope.no_numeric)))+geom_line(aes(PC2,PC3, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab("PC2 (10%)")+ylab("PC3 (8%)")+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

legend<-ggplot(sampleinfo_organoid_notfetal, aes(as.factor(-passage.or.rescope.no_numeric), fill=as.factor(passage.or.rescope.no_numeric)))+geom_bar(color="black")+
  theme_bw()+theme(legend.position = "none", axis.text.y = element_blank(),
                   axis.title.y = element_blank(),
                   axis.ticks.y = element_blank(),
                   legend.title=element_text(size=10),
                   legend.text=element_text(size=8))+
  coord_flip()+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+th

r <- ggplot() + theme_void()

grid.arrange(pc_plt,arrangeGrob(r,legend,r, heights=c(0.6,1.25,0.4)), ncol=2, widths=c(7,1))

Variable Beta Distribution (not fetal)

Variation<-function(x) {quantile(x, c(0.9), na.rm=T)[[1]]-quantile(x, c(0.1), na.rm=T)[[1]]}
Mval<-function(beta) log2(beta/(1-beta))

MTAB4957_mval= apply(MTAB_organoid_beta_notfetal, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)

ref_range_dnam<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(MTAB4957_beta_VeryVariable<-MTAB_organoid_beta_notfetal[which(ref_range_dnam>=2.75),])#  47924
## [1] 47924    30
## Beta distribution plot
Beta_melted<- melt(MTAB4957_beta_VeryVariable)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,sampleinfo_organoid_notfetal, by.x="ID", by.y="Assay.Name")

Beta_Plot$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot$passage.or.rescope.no_numeric, levels = c(11,9,8,6,4,3,2,1))

ggplot(Beta_Plot, aes(Beta,color=passage.or.rescope.no_numeric.factor))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                      legend.title = element_text(size=10),
                                                      legend.key.size = unit(0.7,"line"))

To view the beta distributions we will also include a line for the 32 primary samples to compare each passage to primary

MTAB4957_mval= apply(organoid_ped_primary, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)

ref_range_dnam_primary<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(organoid_ped_primary_VeryVariable<-organoid_ped_primary[rev(order(ref_range_dnam_primary)),])
## [1] 409528     32

Include the same number of vairable CpGs as organoids varible. So take the 41961 most variable

dim(organoid_ped_primary_VeryVariable<-organoid_ped_primary_VeryVariable[1:41961 ,])
## [1] 41961    32
Beta_melted_MTAB_primary<- melt(organoid_ped_primary_VeryVariable)
Beta_Plot_MTAB_primary<-Beta_melted_MTAB_primary[which(!(is.na(Beta_melted_MTAB_primary$value))),]
colnames(Beta_Plot_MTAB_primary)<-c("CpG","ID","Beta")
Beta_Plot_MTAB_primary<-merge(Beta_Plot_MTAB_primary,sampleinfo_ped_primary, by.x="ID", by.y="Assay.Name")
Beta_plot_primary<-Beta_Plot_MTAB_primary[,c(1:3)]
Beta_plot_primary$passage.or.rescope.no_numeric<-0
Beta_Plot<-Beta_Plot[,c(1:3,23)]

Beta_Plot_combined<-rbind(Beta_plot_primary,Beta_Plot)

Beta_Plot_combined$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot_combined$passage.or.rescope.no_numeric, levels = c(11,9,8,6,4,3,2,1,0))

ggplot(Beta_Plot_combined, aes(Beta,color=as.factor(passage.or.rescope.no_numeric.factor)))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                                       legend.title = element_text(size=10),
                                                                       legend.key.size = unit(0.7,"line"))

ggsave(here("figs","MTAB4957_beta_notfetal_with_primary.pdf"),width = 3.75, height = 2.5)
ggsave(here("figs/jpeg","MTAB4957_beta_notfetal_with_primary.jpeg"), width = 3.75, height = 2.5)

Paired Samples in beta plots

These are just the from the individuals not shared across studies

sampleinfo_organoid_notfetal$sample.site<-as.factor(sampleinfo_organoid_notfetal$Characteristics.sampling.site.)
levels(sampleinfo_organoid_notfetal$sample.site)<-c("SC","TI")
sampleinfo_organoid_notfetal$sample_ID<-paste(sampleinfo_organoid_notfetal$Characteristics.individual., sampleinfo_organoid_notfetal$sample.site)
sampleinfo_organoid_paired_unique<-sampleinfo_organoid_notfetal[which(sampleinfo_organoid_notfetal$sample_ID%in%sampleinfo_organoid_notfetal$sample_ID[duplicated(sampleinfo_organoid_notfetal$sample_ID)]),]


MTAB4957.organoid_paired<-do.call(rbind,lapply(1:length(unique(sampleinfo_organoid_paired_unique$sample_ID)), function(x){
  sample<-unique(sampleinfo_organoid_paired_unique$sample_ID)[x]
  samp<-sampleinfo_organoid_paired_unique[sampleinfo_organoid_paired_unique$sample_ID==sample,]
  samp<-samp[order(samp$passage.or.rescope.no_numeric),]
  samp$hilo<-as.factor(samp$passage.or.rescope.no_numeric)

  if(length(levels(samp$hilo))==2){levels(samp$hilo)<-c("lower","higher")}else{
    if(length(levels(samp$hilo))==3){levels(samp$hilo)<-c("lower","higher","highest")}else{
      if(length(levels(samp$hilo))==4){levels(samp$hilo)<-c("lowest","lower","higher","highest")}else{samp$hilo<-NA}
    }
  }
  samp
}))

MTAB4957.organoid_paired<-MTAB4957.organoid_paired[which(!is.na(MTAB4957.organoid_paired$hilo)),]
## will include 224 in the combined plot with its passage 2,3 samples that were on the epic
MTAB4957.organoid_paired<-MTAB4957.organoid_paired[-(grep("224", MTAB4957.organoid_paired$Source.Name)),]

MTAB4957_beta_VeryVariable_paird<-MTAB4957_beta_VeryVariable[,which(sampleinfo_organoid_notfetal$sample_ID%in%MTAB4957.organoid_paired$sample_ID)]

Beta_melted<- melt(MTAB4957_beta_VeryVariable_paird)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,MTAB4957.organoid_paired, by.x="ID", by.y="Assay.Name")


labels<-as.data.frame(tapply(MTAB4957.organoid_paired$passage.or.rescope.no_numeric, MTAB4957.organoid_paired$sample_ID, function(x) paste(x, collapse=", ")))
colnames(labels)<-"passge"
labels$sample_ID<-rownames(labels)

ggplot()+
  geom_density(aes(Beta,color=hilo, group=ID),Beta_Plot, size=0.75)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values = c ("#9ecae1", "#225ea8", "#081d58"), name="Relative\nPassage\nLevel within\nPatient")+facet_wrap(~sample_ID, nrow=1)+
  geom_text(aes(0.75, 2.75, label=passge), data=labels, color="grey20")+th+theme(strip.text = element_text(size = 10),
                                                                                 axis.text=element_text(size=4),
                                                                                 panel.spacing = unit(0.7, "lines"))+th+
  scale_x_continuous(breaks = c(0,0.5,1))

ggsave(here("figs","MTAB4957_beta_paired_notfetal.pdf"),width = 5, height = 2.2)
ggsave(here("figs/jpeg","MTAB4957_beta_paired_notfetal.jpeg"), width = 5, height = 2.2)

Paired not fetal EPIC and 450K

these are individuals present in both studies

intersect(sampleinfo_organoid_paired$Characteristics.individual., epic.organoid$case.no)
## [1] "212" "223" "224"
organoid_Mval = apply(organoid_beta, 1, Mval) # need mvalues for combat
organoid_Mval = as.data.frame(organoid_Mval)
organoid_Mval = t(organoid_Mval)

ref_range_dnam<-sapply(1:nrow(organoid_Mval), function(x) Variation(organoid_Mval[x,]))
organoid_beta_VeryVariable<-organoid_beta[which(ref_range_dnam>=2.75),]#  51545

“212” “223” “224” in both studes

epic.organoid_paired<-epic.organoid[grep("212|223|224",epic.organoid$case.no),]

MTAB4957_beta_VeryVariable_paird<-MTAB4957_beta_for_paird[which(rownames(MTAB4957_beta_for_paird)%in%rownames(MTAB4957_beta_VeryVariable)),]
identical(colnames(MTAB4957_beta_VeryVariable_paird), as.character(sampleinfo_organoid_paired$Assay.Name))
## [1] TRUE
epic.organoid_beta_VeryVariable_paird<-organoid_beta_VeryVariable[,which(colnames(organoid_beta_VeryVariable)%in%epic.organoid_paired$array.id)]
epic.organoid_beta_VeryVariable_paird<-epic.organoid_beta_VeryVariable_paird[,match(epic.organoid_paired$array.id,colnames(epic.organoid_beta_VeryVariable_paird))]
identical(colnames(epic.organoid_beta_VeryVariable_paird), as.character(epic.organoid_paired$array.id))
## [1] TRUE
epic.organoid_paired$Study<-"Original Organoids"

sampleinfo_organoid_paired$Study<-"E-MTAB-4957"
sampleinfo_organoid_paired$sample_ID<-gsub(" sigmoid colon", " SC",sampleinfo_organoid_paired$sample_ID)
sampleinfo_organoid_paired$sample_ID<-gsub(" terminal ileum", " TI",sampleinfo_organoid_paired$sample_ID)
colnames(sampleinfo_organoid_paired)[c(4,16)]<-c("case.no","array.id")

samplinfo_paired_combined<-rbind(epic.organoid_paired[,c(1,2,14,17,18)],sampleinfo_organoid_paired[,c(4,16,22,21,24)])

variable_beta_combined<-merge(epic.organoid_beta_VeryVariable_paird,MTAB4957_beta_VeryVariable_paird, by="row.names")
variable_beta_combined$Row.names<-NULL
identical(colnames(variable_beta_combined), as.character(samplinfo_paired_combined$array.id))
## [1] TRUE
samplinfo_paired_combined<-do.call(rbind,lapply(1:length(unique(samplinfo_paired_combined$sample_ID)), function(x){
  sample<-unique(samplinfo_paired_combined$sample_ID)[x]
  samp<-samplinfo_paired_combined[samplinfo_paired_combined$sample_ID==sample,]
  samp<-samp[order(samp$passage.or.rescope.no_numeric),]
  samp$hilo<-as.factor(samp$passage.or.rescope.no_numeric)
  
  if(length(levels(samp$hilo))==2){levels(samp$hilo)<-c("lower","higher")}else{
    if(length(levels(samp$hilo))==3){levels(samp$hilo)<-c("lower","higher","highest")}else{
      if(length(levels(samp$hilo))==4){levels(samp$hilo)<-c("lowest","lower","higher","highest")}else{samp$hilo<-NA}
    }
  }
  samp
}))


Beta_melted<- melt(variable_beta_combined)
## No id variables; using all as measure variables
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("ID","Beta")
Beta_Plot<-merge(Beta_Plot,samplinfo_paired_combined, by.x="ID", by.y="array.id")

Beta_Plot$hilo_epic<-paste(Beta_Plot$hilo,"\n", Beta_Plot$Study, sep="")
Beta_Plot$hilo_epic<-factor(Beta_Plot$hilo_epic, levels=c("lower\nOriginal Organoids", "lower\nE-MTAB-4957", "higher\nE-MTAB-4957", "highest\nE-MTAB-4957"))

labels<-as.data.frame(tapply(samplinfo_paired_combined$passage.or.rescope.no_numeric, list(samplinfo_paired_combined$sample_ID,samplinfo_paired_combined$Study), function(x) paste(x, collapse=", ")))
labels$sample_ID<-rownames(labels)
colnames(labels)<-c("MTAB","OG","sample_ID")

labels$MTAB<-paste("E-MTAB-4957: ", labels$MTAB, sep="")
labels$OG<-paste("Original Organoid: ", labels$OG, sep="")



ggplot()+
  geom_density(aes(Beta,color=hilo_epic, group=ID),Beta_Plot, size=0.75)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values = c ("#ef3b2c", "#9ecae1","#225ea8","#081d58"), name="Relative\nPassage\nLevel within\nPatient")+facet_wrap(~sample_ID, nrow=3)+
  geom_text(aes(0.5, 2.65, label=MTAB), data=labels, color="grey20", size=2.75)+
  geom_text(aes(0.5, 2.35, label=OG), data=labels, color="grey20", size=2.75)+
  th+theme(strip.text = element_text(size = 12),
           axis.text=element_text(size=10),
           panel.spacing = unit(0.7, "lines"),
        legend.text=element_text(size=9.5),
        legend.title=element_text(size=12))+ scale_x_continuous(breaks = c(0,0.5,1))

ggsave(here("figs","MTAB4957_EPIC_beta_paired.pdf"),width = 6, height = 6)
ggsave(here("figs/jpeg","MTAB4957_EPIC_beta_paired.jpeg"), width = 6, height = 6)

Thresholding trimodal samples

sampleinfo_organoid_notfetal$thresholded_prior_I<-sapply(1:nrow(sampleinfo_organoid_notfetal), function(x){
  passage<-paste("passage: ",sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric[x],"\nIndividual: ", sampleinfo_organoid_notfetal$case.no[x],"\nThreshold: " ,sampleinfo_organoid_notfetal$thresholded_passage[x], sep="")
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  res$prior_I
})
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -270103.38       0.60       0.23       0.15       0.02       0.16
##  [7]       0.10       0.87       0.04       0.51       0.05
##  [1] -265615.03       0.64       0.20       0.12       0.03       0.18
##  [7]       0.11       0.85       0.04       0.51       0.05
##  [1] -264789.93       0.66       0.19       0.11       0.04       0.20
##  [7]       0.11       0.84       0.04       0.52       0.05
##  [1] -264484.65       0.67       0.18       0.10       0.04       0.21
##  [7]       0.12       0.83       0.05       0.52       0.05
##  [1] -264372.38       0.67       0.18       0.10       0.05       0.22
##  [7]       0.13       0.83       0.05       0.52       0.05
##  [1] -264345.26       0.67       0.18       0.10       0.05       0.22
##  [7]       0.13       0.82       0.05       0.53       0.05
##  [1] -264354.33       0.66       0.18       0.10       0.06       0.23
##  [7]       0.13       0.82       0.05       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267948.50       0.57       0.28       0.12       0.02       0.14
##  [7]       0.11       0.87       0.04       0.50       0.05
##  [1] -265300.54       0.62       0.26       0.09       0.03       0.15
##  [7]       0.12       0.85       0.04       0.51       0.04
##  [1] -264779.32       0.63       0.25       0.08       0.04       0.16
##  [7]       0.13       0.84       0.05       0.51       0.04
##  [1] -264588.26       0.64       0.25       0.07       0.04       0.17
##  [7]       0.14       0.83       0.05       0.51       0.04
##  [1] -264520.21       0.64       0.25       0.07       0.05       0.17
##  [7]       0.15       0.82       0.05       0.51       0.04
##  [1] -264506.39       0.64       0.25       0.06       0.05       0.17
##  [7]       0.15       0.82       0.06       0.52       0.04
##  [1] -264515.52       0.64       0.25       0.06       0.05       0.18
##  [7]       0.16       0.81       0.06       0.52       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265933.53       0.55       0.26       0.16       0.02       0.13
##  [7]       0.10       0.89       0.04       0.51       0.05
##  [1] -264071.05       0.60       0.24       0.13       0.03       0.14
##  [7]       0.11       0.88       0.05       0.51       0.04
##  [1] -263961.23       0.62       0.23       0.12       0.03       0.15
##  [7]       0.11       0.88       0.06       0.51       0.04
##  [1] -263992.53       0.63       0.22       0.11       0.04       0.15
##  [7]       0.12       0.87       0.07       0.52       0.04
##  [1] -264031.72       0.63       0.21       0.10       0.05       0.15
##  [7]       0.12       0.87       0.07       0.52       0.04
##  [1] -264052.59       0.64       0.21       0.10       0.05       0.15
##  [7]       0.12       0.87       0.07       0.52       0.04
##  [1] -264052.24       0.64       0.21       0.10       0.06       0.15
##  [7]       0.13       0.86       0.08       0.52       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268327.69       0.57       0.27       0.13       0.02       0.14
##  [7]       0.10       0.88       0.04       0.50       0.05
##  [1] -265244.38       0.62       0.26       0.10       0.03       0.16
##  [7]       0.11       0.86       0.05       0.51       0.04
##  [1] -264777.32       0.63       0.25       0.08       0.03       0.17
##  [7]       0.11       0.85       0.05       0.51       0.04
##  [1] -264611.62       0.64       0.25       0.07       0.04       0.17
##  [7]       0.12       0.84       0.06       0.51       0.04
##  [1] -264544.80       0.64       0.24       0.07       0.05       0.18
##  [7]       0.13       0.84       0.06       0.51       0.04
##  [1] -264519.73       0.64       0.24       0.07       0.05       0.18
##  [7]       0.13       0.83       0.07       0.52       0.04
##  [1] -264512.51       0.64       0.24       0.06       0.05       0.18
##  [7]       0.13       0.83       0.07       0.52       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -263896.17       0.53       0.28       0.17       0.02       0.13
##  [7]       0.10       0.89       0.03       0.51       0.04
##  [1] -262666.79       0.57       0.26       0.15       0.03       0.13
##  [7]       0.11       0.88       0.04       0.51       0.04
##  [1] -262764.58       0.58       0.25       0.13       0.03       0.14
##  [7]       0.11       0.88       0.04       0.52       0.03
##  [1] -262945.65       0.59       0.24       0.12       0.04       0.14
##  [7]       0.12       0.88       0.04       0.52       0.03
##  [1] -263099.52       0.59       0.24       0.12       0.05       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263205.18       0.59       0.24       0.12       0.05       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263263.73       0.59       0.24       0.12       0.06       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263283.02       0.58       0.24       0.12       0.06       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263272.14       0.58       0.24       0.12       0.07       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263239.43       0.57       0.24       0.12       0.07       0.14
##  [7]       0.11       0.88       0.04       0.53       0.03
##  [1] -263191.70       0.57       0.24       0.12       0.08       0.14
##  [7]       0.11       0.89       0.04       0.53       0.03
##  [1] -263134.21       0.56       0.24       0.12       0.08       0.13
##  [7]       0.11       0.89       0.03       0.53       0.03
##  [1] -263070.82       0.56       0.24       0.12       0.09       0.13
##  [7]       0.11       0.89       0.03       0.54       0.03
##  [1] -263004.31       0.55       0.24       0.12       0.09       0.13
##  [7]       0.11       0.89       0.03       0.54       0.03
##  [1] -262936.65       0.54       0.24       0.12       0.09       0.13
##  [7]       0.10       0.89       0.03       0.54       0.03
##  [1] -262869.21       0.54       0.24       0.12       0.10       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262802.94       0.53       0.24       0.12       0.10       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262738.49       0.53       0.25       0.12       0.10       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262676.33       0.52       0.25       0.12       0.11       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262616.73       0.52       0.25       0.12       0.11       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262559.87       0.51       0.25       0.13       0.11       0.13
##  [7]       0.09       0.89       0.03       0.54       0.04
##  [1] -262505.87       0.51       0.25       0.13       0.12       0.13
##  [7]       0.09       0.89       0.03       0.54       0.04
##  [1] -262454.74       0.50       0.25       0.13       0.12       0.13
##  [7]       0.09       0.89       0.03       0.54       0.04
##  [1] -262406.49       0.50       0.25       0.13       0.12       0.12
##  [7]       0.09       0.89       0.03       0.53       0.04
##  [1] -262361.06       0.49       0.25       0.13       0.13       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262318.39       0.49       0.25       0.13       0.13       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262278.38       0.48       0.25       0.13       0.13       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262240.94       0.47       0.26       0.13       0.14       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262205.95       0.47       0.26       0.13       0.14       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262173.30       0.46       0.26       0.13       0.14       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262142.87       0.46       0.26       0.14       0.15       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262114.55       0.45       0.26       0.14       0.15       0.12
##  [7]       0.08       0.89       0.03       0.53       0.05
##  [1] -262088.22       0.45       0.26       0.14       0.15       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262063.77       0.44       0.26       0.14       0.16       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262041.10       0.44       0.26       0.14       0.16       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262020.09       0.43       0.26       0.14       0.16       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262000.64       0.43       0.26       0.14       0.17       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261982.67       0.42       0.27       0.14       0.17       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261966.07       0.42       0.27       0.14       0.17       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261950.77       0.41       0.27       0.14       0.18       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261936.67       0.41       0.27       0.15       0.18       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261923.71       0.40       0.27       0.15       0.18       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261911.80       0.40       0.27       0.15       0.19       0.12
##  [7]       0.08       0.89       0.03       0.53       0.07
##  [1] -261900.89       0.39       0.27       0.15       0.19       0.12
##  [7]       0.08       0.89       0.03       0.53       0.07
##  [1] -261890.90       0.38       0.27       0.15       0.19       0.12
##  [7]       0.08       0.89       0.03       0.53       0.07
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -262708.15       0.52       0.31       0.15       0.02       0.12
##  [7]       0.10       0.89       0.04       0.51       0.04
##  [1] -262094.06       0.55       0.30       0.12       0.03       0.12
##  [7]       0.11       0.89       0.04       0.51       0.04
##  [1] -262305.06       0.57       0.29       0.10       0.04       0.12
##  [7]       0.11       0.89       0.04       0.51       0.03
##  [1] -262532.42       0.58       0.29       0.09       0.04       0.12
##  [7]       0.11       0.89       0.04       0.52       0.03
##  [1] -262689.47       0.58       0.28       0.09       0.05       0.12
##  [7]       0.11       0.89       0.04       0.52       0.03
##  [1] -262769.54       0.57       0.28       0.09       0.06       0.12
##  [7]       0.11       0.89       0.04       0.52       0.03
##  [1] -262784.47       0.57       0.28       0.08       0.07       0.12
##  [7]       0.10       0.89       0.04       0.52       0.03
##  [1] -262750.07       0.57       0.28       0.08       0.07       0.12
##  [7]       0.10       0.89       0.04       0.52       0.03
##  [1] -262681.12       0.56       0.28       0.08       0.08       0.11
##  [7]       0.10       0.90       0.04       0.52       0.03
##  [1] -262589.52       0.55       0.28       0.08       0.08       0.11
##  [7]       0.09       0.90       0.03       0.52       0.03
##  [1] -262483.94       0.55       0.28       0.08       0.09       0.11
##  [7]       0.09       0.90       0.03       0.52       0.03
##  [1] -262370.21       0.54       0.28       0.08       0.10       0.11
##  [7]       0.08       0.90       0.03       0.52       0.03
##  [1] -262252.07       0.54       0.28       0.08       0.10       0.11
##  [7]       0.08       0.90       0.03       0.52       0.03
##  [1] -262131.87       0.53       0.28       0.09       0.10       0.10
##  [7]       0.08       0.90       0.03       0.52       0.04
##  [1] -262011.14       0.52       0.28       0.09       0.11       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261890.93       0.52       0.28       0.09       0.11       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261772.07       0.51       0.28       0.09       0.12       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261655.24       0.51       0.28       0.09       0.12       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261541.06       0.50       0.28       0.09       0.13       0.10
##  [7]       0.06       0.90       0.03       0.52       0.05
##  [1] -261430.07       0.50       0.28       0.09       0.13       0.10
##  [7]       0.06       0.90       0.03       0.52       0.05
##  [1] -261322.75       0.50       0.28       0.09       0.14       0.09
##  [7]       0.06       0.90       0.02       0.52       0.05
##  [1] -261219.50       0.49       0.28       0.09       0.14       0.09
##  [7]       0.06       0.90       0.02       0.52       0.05
##  [1] -261120.66       0.49       0.28       0.09       0.15       0.09
##  [7]       0.05       0.90       0.02       0.51       0.05
##  [1] -261026.50       0.48       0.28       0.09       0.15       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260937.21       0.48       0.28       0.09       0.15       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260852.92       0.47       0.28       0.09       0.16       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260773.68       0.47       0.28       0.09       0.16       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260699.51       0.46       0.28       0.09       0.17       0.09
##  [7]       0.05       0.90       0.02       0.51       0.07
##  [1] -260630.35       0.46       0.28       0.09       0.17       0.09
##  [7]       0.05       0.90       0.02       0.51       0.07
##  [1] -260566.12       0.46       0.28       0.09       0.18       0.09
##  [7]       0.04       0.90       0.02       0.51       0.07
##  [1] -260506.69       0.45       0.28       0.10       0.18       0.09
##  [7]       0.04       0.90       0.02       0.50       0.07
##  [1] -260451.91       0.45       0.27       0.10       0.18       0.08
##  [7]       0.04       0.90       0.02       0.50       0.07
##  [1] -260401.60       0.44       0.27       0.10       0.19       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260355.58       0.44       0.27       0.10       0.19       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260313.63       0.43       0.27       0.10       0.20       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260275.55       0.43       0.27       0.10       0.20       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260241.11       0.42       0.27       0.10       0.21       0.08
##  [7]       0.04       0.90       0.02       0.50       0.09
##  [1] -260210.12       0.42       0.27       0.10       0.21       0.08
##  [7]       0.04       0.90       0.02       0.50       0.09
##  [1] -260182.35       0.41       0.27       0.10       0.21       0.08
##  [7]       0.04       0.90       0.02       0.50       0.09
##  [1] -260157.59       0.41       0.27       0.10       0.22       0.08
##  [7]       0.04       0.90       0.02       0.49       0.09
##  [1] -260135.65       0.40       0.27       0.10       0.22       0.08
##  [7]       0.03       0.90       0.02       0.49       0.09
##  [1] -260116.33       0.40       0.27       0.10       0.23       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260099.44       0.39       0.27       0.10       0.23       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260084.80       0.39       0.27       0.10       0.24       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260072.24       0.38       0.27       0.10       0.24       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260061.60       0.38       0.27       0.10       0.24       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260052.73       0.37       0.27       0.10       0.25       0.08
##  [7]       0.03       0.90       0.02       0.49       0.11
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266156.99       0.55       0.23       0.20       0.02       0.14
##  [7]       0.10       0.89       0.04       0.51       0.05
##  [1] -264021.98       0.60       0.21       0.17       0.03       0.16
##  [7]       0.11       0.88       0.04       0.52       0.04
##  [1] -263767.65       0.62       0.19       0.16       0.03       0.16
##  [7]       0.12       0.87       0.05       0.53       0.04
##  [1] -263720.83       0.63       0.18       0.16       0.04       0.17
##  [7]       0.12       0.87       0.05       0.53       0.04
##  [1] -263732.49       0.63       0.17       0.15       0.04       0.17
##  [7]       0.13       0.87       0.05       0.54       0.04
##  [1] -263758.32       0.63       0.17       0.15       0.04       0.17
##  [7]       0.13       0.87       0.06       0.54       0.04
##  [1] -263781.74       0.63       0.17       0.15       0.05       0.17
##  [7]       0.14       0.87       0.06       0.54       0.04
##  [1] -263797.15       0.63       0.17       0.15       0.05       0.17
##  [7]       0.14       0.86       0.06       0.54       0.04
##  [1] -263803.70       0.63       0.17       0.15       0.05       0.17
##  [7]       0.14       0.86       0.06       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269727.89       0.59       0.24       0.15       0.02       0.16
##  [7]       0.10       0.87       0.04       0.50       0.05
##  [1] -265824.52       0.64       0.22       0.11       0.03       0.18
##  [7]       0.10       0.86       0.05       0.51       0.05
##  [1] -265105.89       0.66       0.21       0.10       0.04       0.19
##  [7]       0.11       0.85       0.05       0.51       0.05
##  [1] -264831.72       0.66       0.20       0.09       0.04       0.20
##  [7]       0.12       0.84       0.06       0.52       0.05
##  [1] -264724.35       0.67       0.20       0.09       0.05       0.20
##  [7]       0.12       0.83       0.06       0.52       0.05
##  [1] -264692.83       0.67       0.20       0.09       0.05       0.21
##  [7]       0.13       0.82       0.06       0.52       0.05
##  [1] -264695.34       0.66       0.20       0.08       0.05       0.21
##  [7]       0.13       0.82       0.06       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269947.47       0.59       0.23       0.16       0.02       0.16
##  [7]       0.10       0.87       0.03       0.51       0.05
##  [1] -264846.57       0.63       0.20       0.14       0.03       0.17
##  [7]       0.10       0.85       0.04       0.52       0.05
##  [1] -263995.09       0.65       0.19       0.13       0.03       0.18
##  [7]       0.11       0.84       0.04       0.53       0.05
##  [1] -263712.86       0.65       0.18       0.13       0.04       0.19
##  [7]       0.12       0.83       0.04       0.53       0.05
##  [1] -263630.37       0.65       0.17       0.13       0.05       0.20
##  [7]       0.12       0.82       0.04       0.54       0.05
##  [1] -263629.81       0.65       0.17       0.13       0.05       0.20
##  [7]       0.13       0.82       0.04       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269866.23       0.59       0.25       0.14       0.02       0.15
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -265124.22       0.63       0.22       0.11       0.03       0.17
##  [7]       0.10       0.85       0.04       0.51       0.05
##  [1] -264322.14       0.65       0.21       0.10       0.04       0.18
##  [7]       0.11       0.83       0.04       0.52       0.04
##  [1] -264044.04       0.65       0.20       0.10       0.04       0.19
##  [7]       0.12       0.83       0.04       0.52       0.04
##  [1] -263955.18       0.65       0.20       0.10       0.05       0.19
##  [7]       0.12       0.82       0.04       0.53       0.04
##  [1] -263947.09       0.65       0.20       0.10       0.05       0.19
##  [7]       0.13       0.81       0.05       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269220.74       0.58       0.24       0.16       0.02       0.15
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -264564.15       0.62       0.22       0.13       0.03       0.16
##  [7]       0.10       0.85       0.03       0.52       0.05
##  [1] -263861.30       0.64       0.21       0.12       0.03       0.17
##  [7]       0.11       0.84       0.04       0.52       0.04
##  [1] -263650.80       0.64       0.20       0.12       0.04       0.18
##  [7]       0.12       0.83       0.04       0.53       0.04
##  [1] -263599.31       0.64       0.20       0.12       0.04       0.18
##  [7]       0.12       0.83       0.04       0.53       0.04
##  [1] -263607.13       0.64       0.19       0.12       0.05       0.18
##  [7]       0.13       0.82       0.04       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269547.80       0.58       0.26       0.14       0.02       0.14
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -264858.17       0.62       0.24       0.11       0.03       0.16
##  [7]       0.11       0.84       0.03       0.52       0.05
##  [1] -264064.33       0.64       0.23       0.10       0.03       0.17
##  [7]       0.11       0.83       0.04       0.52       0.04
##  [1] -263814.50       0.64       0.22       0.10       0.04       0.17
##  [7]       0.12       0.82       0.04       0.53       0.04
##  [1] -263755.59       0.64       0.22       0.09       0.05       0.17
##  [7]       0.13       0.81       0.04       0.53       0.04
##  [1] -263772.13       0.64       0.22       0.09       0.05       0.18
##  [7]       0.13       0.81       0.04       0.53       0.04
##  [1] -263813.35       0.63       0.22       0.10       0.06       0.18
##  [7]       0.13       0.80       0.04       0.54       0.04
##  [1] -263855.78       0.62       0.22       0.10       0.06       0.18
##  [7]       0.13       0.80       0.04       0.54       0.04
##  [1] -263889.57       0.62       0.22       0.10       0.06       0.18
##  [7]       0.14       0.80       0.04       0.54       0.04
##  [1] -263911.83       0.61       0.22       0.10       0.07       0.18
##  [7]       0.14       0.79       0.05       0.54       0.04
##  [1] -263923.03       0.60       0.23       0.10       0.07       0.18
##  [7]       0.14       0.79       0.05       0.54       0.05
##  [1] -263925.03       0.59       0.23       0.11       0.07       0.19
##  [7]       0.14       0.79       0.05       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259769.23       0.48       0.32       0.18       0.02       0.11
##  [7]       0.09       0.90       0.03       0.51       0.04
##  [1] -258980.52       0.50       0.31       0.16       0.03       0.11
##  [7]       0.09       0.90       0.03       0.52       0.03
##  [1] -258886.69       0.51       0.31       0.15       0.04       0.10
##  [7]       0.08       0.90       0.03       0.53       0.02
##  [1] -258870.28       0.51       0.30       0.14       0.05       0.10
##  [7]       0.07       0.90       0.03       0.53       0.02
##  [1] -258823.43       0.50       0.30       0.14       0.06       0.10
##  [7]       0.06       0.91       0.03       0.53       0.02
##  [1] -258740.24       0.49       0.30       0.14       0.07       0.09
##  [7]       0.06       0.91       0.03       0.53       0.02
##  [1] -258641.01       0.48       0.30       0.14       0.09       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258540.12       0.47       0.30       0.14       0.09       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258442.98       0.46       0.30       0.14       0.10       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258351.39       0.45       0.30       0.14       0.11       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258266.40       0.45       0.30       0.14       0.11       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258188.69       0.44       0.30       0.14       0.11       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258118.51       0.44       0.30       0.14       0.12       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258055.68       0.43       0.30       0.14       0.12       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257999.70       0.43       0.30       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257949.91       0.42       0.30       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257905.61       0.42       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257866.12       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257830.82       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257799.17       0.40       0.31       0.15       0.14       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257770.69       0.40       0.31       0.15       0.14       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257744.98       0.40       0.31       0.15       0.14       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257721.71       0.39       0.31       0.15       0.14       0.09
##  [7]       0.04       0.90       0.03       0.53       0.03
##  [1] -257700.60       0.39       0.31       0.16       0.14       0.09
##  [7]       0.04       0.90       0.03       0.53       0.03
##  [1] -257681.41       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.90       0.03       0.53       0.03
##  [1] -257663.93       0.38       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257647.99       0.38       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257633.45       0.37       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257620.19       0.37       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257608.09       0.36       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257597.06       0.36       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257587.03       0.36       0.32       0.16       0.16       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257577.92       0.35       0.32       0.16       0.16       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259752.33       0.48       0.30       0.21       0.02       0.11
##  [7]       0.09       0.90       0.03       0.52       0.04
##  [1] -258793.74       0.50       0.29       0.19       0.02       0.11
##  [7]       0.08       0.90       0.03       0.53       0.03
##  [1] -258696.51       0.51       0.28       0.18       0.03       0.11
##  [7]       0.08       0.90       0.03       0.53       0.02
##  [1] -258686.29       0.51       0.27       0.17       0.04       0.10
##  [7]       0.07       0.91       0.03       0.54       0.02
##  [1] -258671.76       0.50       0.27       0.17       0.06       0.10
##  [7]       0.06       0.91       0.03       0.54       0.02
##  [1] -258638.62       0.50       0.27       0.17       0.07       0.10
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258590.02       0.49       0.27       0.17       0.08       0.10
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258529.95       0.48       0.27       0.17       0.08       0.09
##  [7]       0.05       0.91       0.02       0.54       0.02
##  [1] -258461.69       0.47       0.27       0.17       0.09       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258388.73       0.46       0.27       0.17       0.10       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258314.57       0.46       0.27       0.17       0.10       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258242.06       0.45       0.27       0.17       0.10       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258173.12       0.45       0.27       0.17       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258108.77       0.44       0.27       0.18       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258049.41       0.44       0.27       0.18       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -257994.98       0.44       0.27       0.18       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -257945.22       0.43       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.02       0.55       0.03
##  [1] -257899.73       0.43       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257858.09       0.43       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257819.88       0.42       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257784.72       0.42       0.28       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257752.28       0.42       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257722.24       0.41       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257694.36       0.41       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257668.41       0.41       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257644.20       0.40       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257621.57       0.40       0.28       0.19       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257600.38       0.40       0.28       0.19       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257580.51       0.39       0.28       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257561.86       0.39       0.28       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257544.34       0.39       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257527.87       0.38       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257512.39       0.38       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257497.84       0.38       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257484.16       0.37       0.29       0.19       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257471.32       0.37       0.29       0.19       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.04
##  [1] -257459.26       0.37       0.29       0.19       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.04
##  [1] -257447.96       0.36       0.29       0.19       0.15       0.10
##  [7]       0.05       0.91       0.03       0.54       0.04
##  [1] -257437.38       0.36       0.29       0.19       0.15       0.10
##  [7]       0.05       0.91       0.03       0.54       0.04
##  [1] -257427.48       0.36       0.29       0.20       0.15       0.10
##  [7]       0.05       0.91       0.03       0.54       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259682.08       0.48       0.32       0.19       0.02       0.11
##  [7]       0.09       0.90       0.03       0.52       0.04
##  [1] -258562.83       0.50       0.31       0.16       0.02       0.11
##  [7]       0.08       0.90       0.03       0.53       0.03
##  [1] -258287.60       0.51       0.31       0.15       0.04       0.10
##  [7]       0.07       0.90       0.03       0.54       0.02
##  [1] -258147.95       0.50       0.30       0.15       0.05       0.10
##  [7]       0.06       0.91       0.03       0.54       0.02
##  [1] -258041.31       0.49       0.30       0.14       0.06       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -257953.81       0.48       0.30       0.14       0.07       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -257877.75       0.47       0.30       0.14       0.09       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257803.33       0.46       0.30       0.14       0.09       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257726.26       0.45       0.30       0.15       0.10       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257647.80       0.45       0.30       0.15       0.11       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257571.12       0.44       0.30       0.15       0.11       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257498.89       0.43       0.30       0.15       0.11       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257432.62       0.43       0.30       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257372.84       0.42       0.30       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257319.39       0.42       0.31       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257271.81       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257229.49       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257191.79       0.41       0.31       0.16       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257158.14       0.40       0.31       0.16       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257128.01       0.40       0.31       0.16       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257100.95       0.39       0.31       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257076.59       0.39       0.31       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257054.59       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257034.68       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257016.64       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257000.28       0.37       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256985.42       0.37       0.32       0.16       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256971.93       0.37       0.32       0.16       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256959.68       0.36       0.32       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256948.57       0.36       0.32       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256938.52       0.36       0.32       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256929.44       0.35       0.33       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267714.39       0.56       0.23       0.20       0.02       0.16
##  [7]       0.08       0.89       0.04       0.51       0.05
##  [1] -263938.90       0.59       0.21       0.17       0.02       0.17
##  [7]       0.08       0.88       0.05       0.52       0.04
##  [1] -263526.33       0.61       0.20       0.16       0.03       0.18
##  [7]       0.08       0.87       0.05       0.53       0.04
##  [1] -263411.47       0.62       0.19       0.16       0.03       0.18
##  [7]       0.09       0.87       0.06       0.53       0.04
##  [1] -263379.37       0.62       0.19       0.15       0.04       0.18
##  [7]       0.09       0.87       0.06       0.54       0.04
##  [1] -263376.50       0.62       0.18       0.15       0.04       0.18
##  [7]       0.09       0.87       0.06       0.54       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -253828.02       0.42       0.34       0.22       0.01       0.08
##  [7]       0.09       0.92       0.03       0.53       0.03
##  [1] -252199.55       0.43       0.34       0.21       0.02       0.08
##  [7]       0.07       0.93       0.03       0.54       0.02
##  [1] -250701.09       0.42       0.34       0.20       0.04       0.07
##  [7]       0.05       0.93       0.02       0.55       0.02
##  [1] -249255.09       0.41       0.34       0.20       0.05       0.07
##  [7]       0.04       0.93       0.02       0.55       0.01
##  [1] -248268.42       0.39       0.34       0.20       0.07       0.06
##  [7]       0.03       0.93       0.02       0.55       0.01
##  [1] -247715.74       0.38       0.34       0.20       0.08       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -247407.95       0.37       0.34       0.20       0.09       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -247216.70       0.36       0.34       0.20       0.10       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -247084.74       0.36       0.34       0.20       0.11       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -246988.48       0.35       0.34       0.20       0.11       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246916.56       0.35       0.34       0.20       0.11       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246862.17       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246820.65       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246788.64       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246763.70       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246744.05       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246728.40       0.33       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246715.78       0.33       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246705.51       0.33       0.34       0.21       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246697.05       0.33       0.34       0.21       0.13       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268311.76       0.56       0.26       0.16       0.02       0.14
##  [7]       0.10       0.87       0.04       0.51       0.05
##  [1] -264869.59       0.60       0.24       0.13       0.02       0.15
##  [7]       0.10       0.86       0.04       0.52       0.05
##  [1] -264264.43       0.62       0.23       0.12       0.03       0.16
##  [7]       0.11       0.85       0.05       0.52       0.05
##  [1] -264075.80       0.63       0.22       0.11       0.03       0.16
##  [7]       0.11       0.84       0.05       0.53       0.05
##  [1] -264033.05       0.63       0.22       0.11       0.04       0.16
##  [7]       0.11       0.83       0.05       0.54       0.05
##  [1] -264045.28       0.63       0.21       0.11       0.04       0.16
##  [7]       0.12       0.83       0.06       0.54       0.05
##  [1] -264073.40       0.63       0.21       0.11       0.04       0.16
##  [7]       0.12       0.82       0.06       0.54       0.05
##  [1] -264100.52       0.63       0.21       0.11       0.05       0.16
##  [7]       0.12       0.82       0.06       0.54       0.05
##  [1] -264120.22       0.63       0.21       0.11       0.05       0.16
##  [7]       0.12       0.82       0.06       0.55       0.05
##  [1] -264131.03       0.62       0.21       0.11       0.05       0.16
##  [7]       0.12       0.81       0.06       0.55       0.05
##  [1] -264133.60       0.62       0.21       0.11       0.05       0.16
##  [7]       0.12       0.81       0.07       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -254974.48       0.43       0.34       0.22       0.01       0.09
##  [7]       0.08       0.92       0.04       0.53       0.03
##  [1] -252511.69       0.43       0.34       0.21       0.02       0.08
##  [7]       0.06       0.93       0.03       0.54       0.02
##  [1] -250890.99       0.42       0.34       0.20       0.03       0.08
##  [7]       0.04       0.93       0.03       0.55       0.02
##  [1] -249675.09       0.41       0.34       0.20       0.05       0.07
##  [7]       0.03       0.93       0.02       0.56       0.01
##  [1] -249019.66       0.40       0.34       0.20       0.07       0.07
##  [7]       0.03       0.93       0.02       0.56       0.01
##  [1] -248695.64       0.38       0.34       0.20       0.08       0.07
##  [7]       0.02       0.93       0.02       0.56       0.01
##  [1] -248505.23       0.37       0.34       0.20       0.09       0.07
##  [7]       0.02       0.93       0.02       0.56       0.01
##  [1] -248368.00       0.36       0.34       0.20       0.10       0.07
##  [7]       0.02       0.94       0.02       0.56       0.01
##  [1] -248260.60       0.36       0.34       0.20       0.10       0.07
##  [7]       0.02       0.94       0.02       0.56       0.01
##  [1] -248176.03       0.35       0.34       0.20       0.11       0.07
##  [7]       0.02       0.94       0.02       0.56       0.02
##  [1] -248110.23       0.35       0.34       0.20       0.11       0.07
##  [7]       0.02       0.94       0.02       0.56       0.02
##  [1] -248059.55       0.34       0.34       0.20       0.11       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -248020.73       0.34       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247991.03       0.34       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247968.26       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247950.76       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247937.26       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247926.81       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247918.69       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268423.74       0.56       0.26       0.16       0.02       0.14
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264725.62       0.60       0.24       0.14       0.02       0.16
##  [7]       0.09       0.86       0.05       0.52       0.05
##  [1] -264166.59       0.61       0.23       0.12       0.03       0.16
##  [7]       0.10       0.85       0.05       0.52       0.05
##  [1] -263987.36       0.62       0.23       0.12       0.03       0.16
##  [7]       0.10       0.85       0.05       0.53       0.05
##  [1] -263932.07       0.63       0.22       0.12       0.04       0.17
##  [7]       0.10       0.84       0.06       0.53       0.05
##  [1] -263924.51       0.63       0.22       0.12       0.04       0.17
##  [7]       0.10       0.84       0.06       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269112.94       0.57       0.19       0.22       0.02       0.19
##  [7]       0.07       0.90       0.04       0.50       0.05
##  [1] -262769.93       0.60       0.18       0.19       0.02       0.21
##  [7]       0.06       0.90       0.05       0.51       0.05
##  [1] -262337.82       0.61       0.18       0.18       0.03       0.22
##  [7]       0.06       0.89       0.06       0.52       0.04
##  [1] -262300.57       0.61       0.18       0.18       0.04       0.22
##  [7]       0.06       0.89       0.06       0.52       0.04
##  [1] -262314.44       0.61       0.18       0.17       0.04       0.22
##  [7]       0.06       0.89       0.07       0.53       0.04
##  [1] -262327.74       0.61       0.17       0.17       0.04       0.23
##  [7]       0.06       0.89       0.07       0.53       0.04
##  [1] -262333.13       0.60       0.18       0.17       0.05       0.23
##  [7]       0.06       0.89       0.07       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268870.79       0.57       0.22       0.20       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264611.78       0.61       0.19       0.17       0.02       0.17
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -263880.92       0.63       0.18       0.17       0.03       0.18
##  [7]       0.10       0.85       0.05       0.53       0.05
##  [1] -263638.33       0.63       0.17       0.16       0.03       0.18
##  [7]       0.10       0.85       0.05       0.54       0.05
##  [1] -263565.74       0.63       0.17       0.16       0.04       0.18
##  [7]       0.11       0.84       0.05       0.54       0.05
##  [1] -263560.16       0.63       0.16       0.17       0.04       0.19
##  [7]       0.11       0.84       0.05       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266085.21       0.54       0.26       0.18       0.02       0.14
##  [7]       0.09       0.89       0.04       0.51       0.05
##  [1] -263827.11       0.58       0.24       0.16       0.02       0.15
##  [7]       0.10       0.89       0.05       0.51       0.05
##  [1] -263664.02       0.59       0.23       0.14       0.03       0.15
##  [7]       0.10       0.88       0.06       0.51       0.05
##  [1] -263675.17       0.60       0.23       0.14       0.03       0.15
##  [7]       0.11       0.88       0.06       0.52       0.04
##  [1] -263708.66       0.61       0.22       0.13       0.03       0.15
##  [7]       0.11       0.88       0.07       0.52       0.05
##  [1] -263733.79       0.61       0.22       0.13       0.04       0.15
##  [7]       0.11       0.88       0.07       0.52       0.05
##  [1] -263744.90       0.61       0.22       0.13       0.04       0.15
##  [7]       0.11       0.87       0.07       0.53       0.05
##  [1] -263743.16       0.61       0.22       0.13       0.04       0.15
##  [7]       0.11       0.87       0.07       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267783.99       0.55       0.24       0.19       0.02       0.14
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264451.58       0.59       0.22       0.17       0.02       0.16
##  [7]       0.10       0.86       0.04       0.52       0.05
##  [1] -263902.03       0.61       0.20       0.16       0.03       0.16
##  [7]       0.10       0.86       0.05       0.53       0.05
##  [1] -263734.51       0.62       0.20       0.16       0.03       0.16
##  [7]       0.11       0.85       0.05       0.53       0.05
##  [1] -263692.89       0.62       0.19       0.15       0.03       0.17
##  [7]       0.11       0.85       0.05       0.54       0.05
##  [1] -263697.11       0.62       0.19       0.16       0.04       0.17
##  [7]       0.11       0.84       0.05       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267731.20       0.56       0.23       0.19       0.02       0.15
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -264741.01       0.61       0.21       0.16       0.03       0.17
##  [7]       0.11       0.87       0.04       0.51       0.05
##  [1] -264280.40       0.63       0.19       0.15       0.03       0.18
##  [7]       0.12       0.86       0.05       0.51       0.05
##  [1] -264141.67       0.64       0.18       0.15       0.03       0.19
##  [7]       0.13       0.86       0.05       0.52       0.05
##  [1] -264103.36       0.64       0.18       0.14       0.04       0.19
##  [7]       0.13       0.85       0.05       0.52       0.05
##  [1] -264100.96       0.64       0.18       0.14       0.04       0.20
##  [7]       0.14       0.85       0.05       0.52       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269373.79       0.57       0.23       0.18       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264821.04       0.61       0.21       0.15       0.02       0.18
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -264141.75       0.63       0.20       0.14       0.03       0.19
##  [7]       0.10       0.85       0.04       0.52       0.05
##  [1] -263917.19       0.63       0.20       0.14       0.03       0.19
##  [7]       0.10       0.84       0.04       0.52       0.05
##  [1] -263834.91       0.64       0.19       0.14       0.04       0.20
##  [7]       0.11       0.84       0.05       0.52       0.05
##  [1] -263809.12       0.63       0.19       0.14       0.04       0.20
##  [7]       0.11       0.84       0.05       0.53       0.05
##  [1] -263807.02       0.63       0.19       0.14       0.04       0.21
##  [7]       0.11       0.83       0.05       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269824.44       0.58       0.22       0.18       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264469.04       0.61       0.20       0.16       0.02       0.18
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -263727.89       0.63       0.19       0.15       0.03       0.19
##  [7]       0.09       0.85       0.04       0.52       0.05
##  [1] -263495.11       0.63       0.19       0.15       0.03       0.20
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -263416.64       0.63       0.18       0.15       0.04       0.21
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -263398.92       0.63       0.18       0.15       0.04       0.21
##  [7]       0.10       0.84       0.05       0.54       0.05
##  [1] -263406.91       0.63       0.18       0.15       0.04       0.21
##  [7]       0.10       0.83       0.05       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266204.55       0.54       0.29       0.15       0.02       0.13
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -263950.82       0.58       0.28       0.12       0.03       0.14
##  [7]       0.10       0.87       0.04       0.51       0.04
##  [1] -263705.08       0.60       0.27       0.10       0.03       0.14
##  [7]       0.11       0.86       0.05       0.52       0.04
##  [1] -263667.70       0.61       0.26       0.10       0.04       0.14
##  [7]       0.11       0.86       0.05       0.52       0.04
##  [1] -263677.68       0.61       0.26       0.09       0.04       0.15
##  [7]       0.11       0.85       0.05       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267788.65       0.56       0.25       0.17       0.02       0.14
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -264614.76       0.60       0.23       0.14       0.02       0.16
##  [7]       0.10       0.86       0.04       0.51       0.05
##  [1] -264115.96       0.61       0.22       0.13       0.03       0.16
##  [7]       0.11       0.86       0.05       0.52       0.05
##  [1] -263956.11       0.62       0.22       0.13       0.03       0.17
##  [7]       0.11       0.85       0.05       0.53       0.05
##  [1] -263908.95       0.63       0.21       0.13       0.04       0.17
##  [7]       0.12       0.85       0.05       0.53       0.05
##  [1] -263905.77       0.63       0.21       0.13       0.04       0.17
##  [7]       0.12       0.84       0.06       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265331.09       0.54       0.19       0.25       0.02       0.15
##  [7]       0.10       0.89       0.04       0.51       0.05
##  [1] -263295.51       0.58       0.16       0.23       0.02       0.16
##  [7]       0.12       0.88       0.04       0.52       0.04
##  [1] -262972.47       0.60       0.14       0.23       0.03       0.17
##  [7]       0.13       0.88       0.05       0.53       0.04
##  [1] -262887.34       0.61       0.13       0.23       0.03       0.18
##  [7]       0.14       0.87       0.05       0.54       0.04
##  [1] -262885.31       0.61       0.12       0.23       0.04       0.19
##  [7]       0.15       0.87       0.06       0.54       0.04
ggplot(sampleinfo_organoid_notfetal, aes(as.numeric(as.character(passage.or.rescope.no_numeric)), thresholded_prior_I))+
  geom_point(size=2,shape=21,color="black",aes(fill=as.factor(passage.or.rescope.no_numeric)))+xlab("Passage")+
  ylab("Intermediate Peak Prior")+theme_bw()+theme(axis.title = element_text(size=12))+
  #geom_text(aes(label=count, vjust=vjust, hjust=hjust), color="grey40", size=3)+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_mixture_model_prior_I.pdf"), width=3, height=2)


sampleinfo_organoid_notfetal$thresholded_prior10<-F
sampleinfo_organoid_notfetal$thresholded_prior10[which(sampleinfo_organoid_notfetal$thresholded_prior_I>0.10)]<-T

percent_passing<-round((tapply(sampleinfo_organoid_notfetal$thresholded_prior10, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, sum)/tapply(sampleinfo_organoid_notfetal$array.id, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, length))*100,2)
passed_num<-tapply(sampleinfo_organoid_notfetal$thresholded_prior10, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, sum)
org_numer<-tapply(sampleinfo_organoid_notfetal$array.id, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, length)

df<-data.frame(passage=names(percent_passing), passing=percent_passing, pro_passing=percent_passing/100, count=org_numer, passed_num=passed_num)
df$passage.factor <- factor(df$passage, levels = c(11,9,8,6,4,3,2,1))


df<-cbind(df,(binom.confint(df$passed_num, df$count, method="exact", conf.level=0.95)))
df$upper<-df$upper*100
df$lower<-df$lower*100

ggplot(df, aes(as.numeric(as.character(passage)), passing))+
  geom_errorbar(aes(ymin=lower, ymax=upper), colour="grey70", width=.25)+
  geom_line(color="grey20")+geom_point(size=1.25,shape=21,color="black",aes(fill=passage.factor))+xlab("Passage")+
  ylab("Samples with Trimodal\nDistribution (%)")+theme_bw()+theme(axis.title = element_text(size=10))+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_mixture_model_prior_I_threshold.pdf"), width=3, height=2)



## plot all samples
plts_paired<-lapply(1:nrow(sampleinfo_organoid_notfetal), function(x){
  passage<-paste("passage: ",sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric[x],"\nIndividual: ", sampleinfo_organoid_notfetal$Characteristics.individual.[x],"\nPrior I: " ,round(sampleinfo_organoid_notfetal$thresholded_prior_I[x],2), sep="")
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  draw_fit_params_gg(converted, counts, res,passage)
})
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -270103.38       0.60       0.23       0.15       0.02       0.16
##  [7]       0.10       0.87       0.04       0.51       0.05
##  [1] -265615.03       0.64       0.20       0.12       0.03       0.18
##  [7]       0.11       0.85       0.04       0.51       0.05
##  [1] -264789.93       0.66       0.19       0.11       0.04       0.20
##  [7]       0.11       0.84       0.04       0.52       0.05
##  [1] -264484.65       0.67       0.18       0.10       0.04       0.21
##  [7]       0.12       0.83       0.05       0.52       0.05
##  [1] -264372.38       0.67       0.18       0.10       0.05       0.22
##  [7]       0.13       0.83       0.05       0.52       0.05
##  [1] -264345.26       0.67       0.18       0.10       0.05       0.22
##  [7]       0.13       0.82       0.05       0.53       0.05
##  [1] -264354.33       0.66       0.18       0.10       0.06       0.23
##  [7]       0.13       0.82       0.05       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267948.50       0.57       0.28       0.12       0.02       0.14
##  [7]       0.11       0.87       0.04       0.50       0.05
##  [1] -265300.54       0.62       0.26       0.09       0.03       0.15
##  [7]       0.12       0.85       0.04       0.51       0.04
##  [1] -264779.32       0.63       0.25       0.08       0.04       0.16
##  [7]       0.13       0.84       0.05       0.51       0.04
##  [1] -264588.26       0.64       0.25       0.07       0.04       0.17
##  [7]       0.14       0.83       0.05       0.51       0.04
##  [1] -264520.21       0.64       0.25       0.07       0.05       0.17
##  [7]       0.15       0.82       0.05       0.51       0.04
##  [1] -264506.39       0.64       0.25       0.06       0.05       0.17
##  [7]       0.15       0.82       0.06       0.52       0.04
##  [1] -264515.52       0.64       0.25       0.06       0.05       0.18
##  [7]       0.16       0.81       0.06       0.52       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265933.53       0.55       0.26       0.16       0.02       0.13
##  [7]       0.10       0.89       0.04       0.51       0.05
##  [1] -264071.05       0.60       0.24       0.13       0.03       0.14
##  [7]       0.11       0.88       0.05       0.51       0.04
##  [1] -263961.23       0.62       0.23       0.12       0.03       0.15
##  [7]       0.11       0.88       0.06       0.51       0.04
##  [1] -263992.53       0.63       0.22       0.11       0.04       0.15
##  [7]       0.12       0.87       0.07       0.52       0.04
##  [1] -264031.72       0.63       0.21       0.10       0.05       0.15
##  [7]       0.12       0.87       0.07       0.52       0.04
##  [1] -264052.59       0.64       0.21       0.10       0.05       0.15
##  [7]       0.12       0.87       0.07       0.52       0.04
##  [1] -264052.24       0.64       0.21       0.10       0.06       0.15
##  [7]       0.13       0.86       0.08       0.52       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268327.69       0.57       0.27       0.13       0.02       0.14
##  [7]       0.10       0.88       0.04       0.50       0.05
##  [1] -265244.38       0.62       0.26       0.10       0.03       0.16
##  [7]       0.11       0.86       0.05       0.51       0.04
##  [1] -264777.32       0.63       0.25       0.08       0.03       0.17
##  [7]       0.11       0.85       0.05       0.51       0.04
##  [1] -264611.62       0.64       0.25       0.07       0.04       0.17
##  [7]       0.12       0.84       0.06       0.51       0.04
##  [1] -264544.80       0.64       0.24       0.07       0.05       0.18
##  [7]       0.13       0.84       0.06       0.51       0.04
##  [1] -264519.73       0.64       0.24       0.07       0.05       0.18
##  [7]       0.13       0.83       0.07       0.52       0.04
##  [1] -264512.51       0.64       0.24       0.06       0.05       0.18
##  [7]       0.13       0.83       0.07       0.52       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -263896.17       0.53       0.28       0.17       0.02       0.13
##  [7]       0.10       0.89       0.03       0.51       0.04
##  [1] -262666.79       0.57       0.26       0.15       0.03       0.13
##  [7]       0.11       0.88       0.04       0.51       0.04
##  [1] -262764.58       0.58       0.25       0.13       0.03       0.14
##  [7]       0.11       0.88       0.04       0.52       0.03
##  [1] -262945.65       0.59       0.24       0.12       0.04       0.14
##  [7]       0.12       0.88       0.04       0.52       0.03
##  [1] -263099.52       0.59       0.24       0.12       0.05       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263205.18       0.59       0.24       0.12       0.05       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263263.73       0.59       0.24       0.12       0.06       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263283.02       0.58       0.24       0.12       0.06       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263272.14       0.58       0.24       0.12       0.07       0.14
##  [7]       0.12       0.88       0.04       0.53       0.03
##  [1] -263239.43       0.57       0.24       0.12       0.07       0.14
##  [7]       0.11       0.88       0.04       0.53       0.03
##  [1] -263191.70       0.57       0.24       0.12       0.08       0.14
##  [7]       0.11       0.89       0.04       0.53       0.03
##  [1] -263134.21       0.56       0.24       0.12       0.08       0.13
##  [7]       0.11       0.89       0.03       0.53       0.03
##  [1] -263070.82       0.56       0.24       0.12       0.09       0.13
##  [7]       0.11       0.89       0.03       0.54       0.03
##  [1] -263004.31       0.55       0.24       0.12       0.09       0.13
##  [7]       0.11       0.89       0.03       0.54       0.03
##  [1] -262936.65       0.54       0.24       0.12       0.09       0.13
##  [7]       0.10       0.89       0.03       0.54       0.03
##  [1] -262869.21       0.54       0.24       0.12       0.10       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262802.94       0.53       0.24       0.12       0.10       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262738.49       0.53       0.25       0.12       0.10       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262676.33       0.52       0.25       0.12       0.11       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262616.73       0.52       0.25       0.12       0.11       0.13
##  [7]       0.10       0.89       0.03       0.54       0.04
##  [1] -262559.87       0.51       0.25       0.13       0.11       0.13
##  [7]       0.09       0.89       0.03       0.54       0.04
##  [1] -262505.87       0.51       0.25       0.13       0.12       0.13
##  [7]       0.09       0.89       0.03       0.54       0.04
##  [1] -262454.74       0.50       0.25       0.13       0.12       0.13
##  [7]       0.09       0.89       0.03       0.54       0.04
##  [1] -262406.49       0.50       0.25       0.13       0.12       0.12
##  [7]       0.09       0.89       0.03       0.53       0.04
##  [1] -262361.06       0.49       0.25       0.13       0.13       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262318.39       0.49       0.25       0.13       0.13       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262278.38       0.48       0.25       0.13       0.13       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262240.94       0.47       0.26       0.13       0.14       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262205.95       0.47       0.26       0.13       0.14       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262173.30       0.46       0.26       0.13       0.14       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262142.87       0.46       0.26       0.14       0.15       0.12
##  [7]       0.09       0.89       0.03       0.53       0.05
##  [1] -262114.55       0.45       0.26       0.14       0.15       0.12
##  [7]       0.08       0.89       0.03       0.53       0.05
##  [1] -262088.22       0.45       0.26       0.14       0.15       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262063.77       0.44       0.26       0.14       0.16       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262041.10       0.44       0.26       0.14       0.16       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262020.09       0.43       0.26       0.14       0.16       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -262000.64       0.43       0.26       0.14       0.17       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261982.67       0.42       0.27       0.14       0.17       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261966.07       0.42       0.27       0.14       0.17       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261950.77       0.41       0.27       0.14       0.18       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261936.67       0.41       0.27       0.15       0.18       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261923.71       0.40       0.27       0.15       0.18       0.12
##  [7]       0.08       0.89       0.03       0.53       0.06
##  [1] -261911.80       0.40       0.27       0.15       0.19       0.12
##  [7]       0.08       0.89       0.03       0.53       0.07
##  [1] -261900.89       0.39       0.27       0.15       0.19       0.12
##  [7]       0.08       0.89       0.03       0.53       0.07
##  [1] -261890.90       0.38       0.27       0.15       0.19       0.12
##  [7]       0.08       0.89       0.03       0.53       0.07
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -262708.15       0.52       0.31       0.15       0.02       0.12
##  [7]       0.10       0.89       0.04       0.51       0.04
##  [1] -262094.06       0.55       0.30       0.12       0.03       0.12
##  [7]       0.11       0.89       0.04       0.51       0.04
##  [1] -262305.06       0.57       0.29       0.10       0.04       0.12
##  [7]       0.11       0.89       0.04       0.51       0.03
##  [1] -262532.42       0.58       0.29       0.09       0.04       0.12
##  [7]       0.11       0.89       0.04       0.52       0.03
##  [1] -262689.47       0.58       0.28       0.09       0.05       0.12
##  [7]       0.11       0.89       0.04       0.52       0.03
##  [1] -262769.54       0.57       0.28       0.09       0.06       0.12
##  [7]       0.11       0.89       0.04       0.52       0.03
##  [1] -262784.47       0.57       0.28       0.08       0.07       0.12
##  [7]       0.10       0.89       0.04       0.52       0.03
##  [1] -262750.07       0.57       0.28       0.08       0.07       0.12
##  [7]       0.10       0.89       0.04       0.52       0.03
##  [1] -262681.12       0.56       0.28       0.08       0.08       0.11
##  [7]       0.10       0.90       0.04       0.52       0.03
##  [1] -262589.52       0.55       0.28       0.08       0.08       0.11
##  [7]       0.09       0.90       0.03       0.52       0.03
##  [1] -262483.94       0.55       0.28       0.08       0.09       0.11
##  [7]       0.09       0.90       0.03       0.52       0.03
##  [1] -262370.21       0.54       0.28       0.08       0.10       0.11
##  [7]       0.08       0.90       0.03       0.52       0.03
##  [1] -262252.07       0.54       0.28       0.08       0.10       0.11
##  [7]       0.08       0.90       0.03       0.52       0.03
##  [1] -262131.87       0.53       0.28       0.09       0.10       0.10
##  [7]       0.08       0.90       0.03       0.52       0.04
##  [1] -262011.14       0.52       0.28       0.09       0.11       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261890.93       0.52       0.28       0.09       0.11       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261772.07       0.51       0.28       0.09       0.12       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261655.24       0.51       0.28       0.09       0.12       0.10
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -261541.06       0.50       0.28       0.09       0.13       0.10
##  [7]       0.06       0.90       0.03       0.52       0.05
##  [1] -261430.07       0.50       0.28       0.09       0.13       0.10
##  [7]       0.06       0.90       0.03       0.52       0.05
##  [1] -261322.75       0.50       0.28       0.09       0.14       0.09
##  [7]       0.06       0.90       0.02       0.52       0.05
##  [1] -261219.50       0.49       0.28       0.09       0.14       0.09
##  [7]       0.06       0.90       0.02       0.52       0.05
##  [1] -261120.66       0.49       0.28       0.09       0.15       0.09
##  [7]       0.05       0.90       0.02       0.51       0.05
##  [1] -261026.50       0.48       0.28       0.09       0.15       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260937.21       0.48       0.28       0.09       0.15       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260852.92       0.47       0.28       0.09       0.16       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260773.68       0.47       0.28       0.09       0.16       0.09
##  [7]       0.05       0.90       0.02       0.51       0.06
##  [1] -260699.51       0.46       0.28       0.09       0.17       0.09
##  [7]       0.05       0.90       0.02       0.51       0.07
##  [1] -260630.35       0.46       0.28       0.09       0.17       0.09
##  [7]       0.05       0.90       0.02       0.51       0.07
##  [1] -260566.12       0.46       0.28       0.09       0.18       0.09
##  [7]       0.04       0.90       0.02       0.51       0.07
##  [1] -260506.69       0.45       0.28       0.10       0.18       0.09
##  [7]       0.04       0.90       0.02       0.50       0.07
##  [1] -260451.91       0.45       0.27       0.10       0.18       0.08
##  [7]       0.04       0.90       0.02       0.50       0.07
##  [1] -260401.60       0.44       0.27       0.10       0.19       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260355.58       0.44       0.27       0.10       0.19       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260313.63       0.43       0.27       0.10       0.20       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260275.55       0.43       0.27       0.10       0.20       0.08
##  [7]       0.04       0.90       0.02       0.50       0.08
##  [1] -260241.11       0.42       0.27       0.10       0.21       0.08
##  [7]       0.04       0.90       0.02       0.50       0.09
##  [1] -260210.12       0.42       0.27       0.10       0.21       0.08
##  [7]       0.04       0.90       0.02       0.50       0.09
##  [1] -260182.35       0.41       0.27       0.10       0.21       0.08
##  [7]       0.04       0.90       0.02       0.50       0.09
##  [1] -260157.59       0.41       0.27       0.10       0.22       0.08
##  [7]       0.04       0.90       0.02       0.49       0.09
##  [1] -260135.65       0.40       0.27       0.10       0.22       0.08
##  [7]       0.03       0.90       0.02       0.49       0.09
##  [1] -260116.33       0.40       0.27       0.10       0.23       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260099.44       0.39       0.27       0.10       0.23       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260084.80       0.39       0.27       0.10       0.24       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260072.24       0.38       0.27       0.10       0.24       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260061.60       0.38       0.27       0.10       0.24       0.08
##  [7]       0.03       0.90       0.02       0.49       0.10
##  [1] -260052.73       0.37       0.27       0.10       0.25       0.08
##  [7]       0.03       0.90       0.02       0.49       0.11
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266156.99       0.55       0.23       0.20       0.02       0.14
##  [7]       0.10       0.89       0.04       0.51       0.05
##  [1] -264021.98       0.60       0.21       0.17       0.03       0.16
##  [7]       0.11       0.88       0.04       0.52       0.04
##  [1] -263767.65       0.62       0.19       0.16       0.03       0.16
##  [7]       0.12       0.87       0.05       0.53       0.04
##  [1] -263720.83       0.63       0.18       0.16       0.04       0.17
##  [7]       0.12       0.87       0.05       0.53       0.04
##  [1] -263732.49       0.63       0.17       0.15       0.04       0.17
##  [7]       0.13       0.87       0.05       0.54       0.04
##  [1] -263758.32       0.63       0.17       0.15       0.04       0.17
##  [7]       0.13       0.87       0.06       0.54       0.04
##  [1] -263781.74       0.63       0.17       0.15       0.05       0.17
##  [7]       0.14       0.87       0.06       0.54       0.04
##  [1] -263797.15       0.63       0.17       0.15       0.05       0.17
##  [7]       0.14       0.86       0.06       0.54       0.04
##  [1] -263803.70       0.63       0.17       0.15       0.05       0.17
##  [7]       0.14       0.86       0.06       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269727.89       0.59       0.24       0.15       0.02       0.16
##  [7]       0.10       0.87       0.04       0.50       0.05
##  [1] -265824.52       0.64       0.22       0.11       0.03       0.18
##  [7]       0.10       0.86       0.05       0.51       0.05
##  [1] -265105.89       0.66       0.21       0.10       0.04       0.19
##  [7]       0.11       0.85       0.05       0.51       0.05
##  [1] -264831.72       0.66       0.20       0.09       0.04       0.20
##  [7]       0.12       0.84       0.06       0.52       0.05
##  [1] -264724.35       0.67       0.20       0.09       0.05       0.20
##  [7]       0.12       0.83       0.06       0.52       0.05
##  [1] -264692.83       0.67       0.20       0.09       0.05       0.21
##  [7]       0.13       0.82       0.06       0.52       0.05
##  [1] -264695.34       0.66       0.20       0.08       0.05       0.21
##  [7]       0.13       0.82       0.06       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269947.47       0.59       0.23       0.16       0.02       0.16
##  [7]       0.10       0.87       0.03       0.51       0.05
##  [1] -264846.57       0.63       0.20       0.14       0.03       0.17
##  [7]       0.10       0.85       0.04       0.52       0.05
##  [1] -263995.09       0.65       0.19       0.13       0.03       0.18
##  [7]       0.11       0.84       0.04       0.53       0.05
##  [1] -263712.86       0.65       0.18       0.13       0.04       0.19
##  [7]       0.12       0.83       0.04       0.53       0.05
##  [1] -263630.37       0.65       0.17       0.13       0.05       0.20
##  [7]       0.12       0.82       0.04       0.54       0.05
##  [1] -263629.81       0.65       0.17       0.13       0.05       0.20
##  [7]       0.13       0.82       0.04       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269866.23       0.59       0.25       0.14       0.02       0.15
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -265124.22       0.63       0.22       0.11       0.03       0.17
##  [7]       0.10       0.85       0.04       0.51       0.05
##  [1] -264322.14       0.65       0.21       0.10       0.04       0.18
##  [7]       0.11       0.83       0.04       0.52       0.04
##  [1] -264044.04       0.65       0.20       0.10       0.04       0.19
##  [7]       0.12       0.83       0.04       0.52       0.04
##  [1] -263955.18       0.65       0.20       0.10       0.05       0.19
##  [7]       0.12       0.82       0.04       0.53       0.04
##  [1] -263947.09       0.65       0.20       0.10       0.05       0.19
##  [7]       0.13       0.81       0.05       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269220.74       0.58       0.24       0.16       0.02       0.15
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -264564.15       0.62       0.22       0.13       0.03       0.16
##  [7]       0.10       0.85       0.03       0.52       0.05
##  [1] -263861.30       0.64       0.21       0.12       0.03       0.17
##  [7]       0.11       0.84       0.04       0.52       0.04
##  [1] -263650.80       0.64       0.20       0.12       0.04       0.18
##  [7]       0.12       0.83       0.04       0.53       0.04
##  [1] -263599.31       0.64       0.20       0.12       0.04       0.18
##  [7]       0.12       0.83       0.04       0.53       0.04
##  [1] -263607.13       0.64       0.19       0.12       0.05       0.18
##  [7]       0.13       0.82       0.04       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269547.80       0.58       0.26       0.14       0.02       0.14
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -264858.17       0.62       0.24       0.11       0.03       0.16
##  [7]       0.11       0.84       0.03       0.52       0.05
##  [1] -264064.33       0.64       0.23       0.10       0.03       0.17
##  [7]       0.11       0.83       0.04       0.52       0.04
##  [1] -263814.50       0.64       0.22       0.10       0.04       0.17
##  [7]       0.12       0.82       0.04       0.53       0.04
##  [1] -263755.59       0.64       0.22       0.09       0.05       0.17
##  [7]       0.13       0.81       0.04       0.53       0.04
##  [1] -263772.13       0.64       0.22       0.09       0.05       0.18
##  [7]       0.13       0.81       0.04       0.53       0.04
##  [1] -263813.35       0.63       0.22       0.10       0.06       0.18
##  [7]       0.13       0.80       0.04       0.54       0.04
##  [1] -263855.78       0.62       0.22       0.10       0.06       0.18
##  [7]       0.13       0.80       0.04       0.54       0.04
##  [1] -263889.57       0.62       0.22       0.10       0.06       0.18
##  [7]       0.14       0.80       0.04       0.54       0.04
##  [1] -263911.83       0.61       0.22       0.10       0.07       0.18
##  [7]       0.14       0.79       0.05       0.54       0.04
##  [1] -263923.03       0.60       0.23       0.10       0.07       0.18
##  [7]       0.14       0.79       0.05       0.54       0.05
##  [1] -263925.03       0.59       0.23       0.11       0.07       0.19
##  [7]       0.14       0.79       0.05       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259769.23       0.48       0.32       0.18       0.02       0.11
##  [7]       0.09       0.90       0.03       0.51       0.04
##  [1] -258980.52       0.50       0.31       0.16       0.03       0.11
##  [7]       0.09       0.90       0.03       0.52       0.03
##  [1] -258886.69       0.51       0.31       0.15       0.04       0.10
##  [7]       0.08       0.90       0.03       0.53       0.02
##  [1] -258870.28       0.51       0.30       0.14       0.05       0.10
##  [7]       0.07       0.90       0.03       0.53       0.02
##  [1] -258823.43       0.50       0.30       0.14       0.06       0.10
##  [7]       0.06       0.91       0.03       0.53       0.02
##  [1] -258740.24       0.49       0.30       0.14       0.07       0.09
##  [7]       0.06       0.91       0.03       0.53       0.02
##  [1] -258641.01       0.48       0.30       0.14       0.09       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258540.12       0.47       0.30       0.14       0.09       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258442.98       0.46       0.30       0.14       0.10       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258351.39       0.45       0.30       0.14       0.11       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258266.40       0.45       0.30       0.14       0.11       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258188.69       0.44       0.30       0.14       0.11       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258118.51       0.44       0.30       0.14       0.12       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -258055.68       0.43       0.30       0.14       0.12       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257999.70       0.43       0.30       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257949.91       0.42       0.30       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257905.61       0.42       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257866.12       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257830.82       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257799.17       0.40       0.31       0.15       0.14       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257770.69       0.40       0.31       0.15       0.14       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257744.98       0.40       0.31       0.15       0.14       0.09
##  [7]       0.04       0.91       0.03       0.53       0.03
##  [1] -257721.71       0.39       0.31       0.15       0.14       0.09
##  [7]       0.04       0.90       0.03       0.53       0.03
##  [1] -257700.60       0.39       0.31       0.16       0.14       0.09
##  [7]       0.04       0.90       0.03       0.53       0.03
##  [1] -257681.41       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.90       0.03       0.53       0.03
##  [1] -257663.93       0.38       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257647.99       0.38       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257633.45       0.37       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257620.19       0.37       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257608.09       0.36       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257597.06       0.36       0.32       0.16       0.15       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257587.03       0.36       0.32       0.16       0.16       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257577.92       0.35       0.32       0.16       0.16       0.09
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259752.33       0.48       0.30       0.21       0.02       0.11
##  [7]       0.09       0.90       0.03       0.52       0.04
##  [1] -258793.74       0.50       0.29       0.19       0.02       0.11
##  [7]       0.08       0.90       0.03       0.53       0.03
##  [1] -258696.51       0.51       0.28       0.18       0.03       0.11
##  [7]       0.08       0.90       0.03       0.53       0.02
##  [1] -258686.29       0.51       0.27       0.17       0.04       0.10
##  [7]       0.07       0.91       0.03       0.54       0.02
##  [1] -258671.76       0.50       0.27       0.17       0.06       0.10
##  [7]       0.06       0.91       0.03       0.54       0.02
##  [1] -258638.62       0.50       0.27       0.17       0.07       0.10
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258590.02       0.49       0.27       0.17       0.08       0.10
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -258529.95       0.48       0.27       0.17       0.08       0.09
##  [7]       0.05       0.91       0.02       0.54       0.02
##  [1] -258461.69       0.47       0.27       0.17       0.09       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258388.73       0.46       0.27       0.17       0.10       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258314.57       0.46       0.27       0.17       0.10       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258242.06       0.45       0.27       0.17       0.10       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258173.12       0.45       0.27       0.17       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258108.77       0.44       0.27       0.18       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -258049.41       0.44       0.27       0.18       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -257994.98       0.44       0.27       0.18       0.11       0.09
##  [7]       0.04       0.91       0.02       0.55       0.02
##  [1] -257945.22       0.43       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.02       0.55       0.03
##  [1] -257899.73       0.43       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257858.09       0.43       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257819.88       0.42       0.27       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257784.72       0.42       0.28       0.18       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257752.28       0.42       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257722.24       0.41       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257694.36       0.41       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257668.41       0.41       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257644.20       0.40       0.28       0.18       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257621.57       0.40       0.28       0.19       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257600.38       0.40       0.28       0.19       0.13       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257580.51       0.39       0.28       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257561.86       0.39       0.28       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257544.34       0.39       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257527.87       0.38       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257512.39       0.38       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257497.84       0.38       0.29       0.19       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257484.16       0.37       0.29       0.19       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257471.32       0.37       0.29       0.19       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.04
##  [1] -257459.26       0.37       0.29       0.19       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.04
##  [1] -257447.96       0.36       0.29       0.19       0.15       0.10
##  [7]       0.05       0.91       0.03       0.54       0.04
##  [1] -257437.38       0.36       0.29       0.19       0.15       0.10
##  [7]       0.05       0.91       0.03       0.54       0.04
##  [1] -257427.48       0.36       0.29       0.20       0.15       0.10
##  [7]       0.05       0.91       0.03       0.54       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259682.08       0.48       0.32       0.19       0.02       0.11
##  [7]       0.09       0.90       0.03       0.52       0.04
##  [1] -258562.83       0.50       0.31       0.16       0.02       0.11
##  [7]       0.08       0.90       0.03       0.53       0.03
##  [1] -258287.60       0.51       0.31       0.15       0.04       0.10
##  [7]       0.07       0.90       0.03       0.54       0.02
##  [1] -258147.95       0.50       0.30       0.15       0.05       0.10
##  [7]       0.06       0.91       0.03       0.54       0.02
##  [1] -258041.31       0.49       0.30       0.14       0.06       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -257953.81       0.48       0.30       0.14       0.07       0.09
##  [7]       0.05       0.91       0.03       0.54       0.02
##  [1] -257877.75       0.47       0.30       0.14       0.09       0.09
##  [7]       0.04       0.91       0.03       0.54       0.02
##  [1] -257803.33       0.46       0.30       0.14       0.09       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257726.26       0.45       0.30       0.15       0.10       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257647.80       0.45       0.30       0.15       0.11       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257571.12       0.44       0.30       0.15       0.11       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257498.89       0.43       0.30       0.15       0.11       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257432.62       0.43       0.30       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257372.84       0.42       0.30       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257319.39       0.42       0.31       0.15       0.12       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257271.81       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257229.49       0.41       0.31       0.15       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.02
##  [1] -257191.79       0.41       0.31       0.16       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257158.14       0.40       0.31       0.16       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257128.01       0.40       0.31       0.16       0.13       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257100.95       0.39       0.31       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257076.59       0.39       0.31       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257054.59       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257034.68       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.55       0.03
##  [1] -257016.64       0.38       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -257000.28       0.37       0.32       0.16       0.14       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256985.42       0.37       0.32       0.16       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256971.93       0.37       0.32       0.16       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256959.68       0.36       0.32       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256948.57       0.36       0.32       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256938.52       0.36       0.32       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] -256929.44       0.35       0.33       0.17       0.15       0.09
##  [7]       0.04       0.91       0.03       0.54       0.03
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267714.39       0.56       0.23       0.20       0.02       0.16
##  [7]       0.08       0.89       0.04       0.51       0.05
##  [1] -263938.90       0.59       0.21       0.17       0.02       0.17
##  [7]       0.08       0.88       0.05       0.52       0.04
##  [1] -263526.33       0.61       0.20       0.16       0.03       0.18
##  [7]       0.08       0.87       0.05       0.53       0.04
##  [1] -263411.47       0.62       0.19       0.16       0.03       0.18
##  [7]       0.09       0.87       0.06       0.53       0.04
##  [1] -263379.37       0.62       0.19       0.15       0.04       0.18
##  [7]       0.09       0.87       0.06       0.54       0.04
##  [1] -263376.50       0.62       0.18       0.15       0.04       0.18
##  [7]       0.09       0.87       0.06       0.54       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -253828.02       0.42       0.34       0.22       0.01       0.08
##  [7]       0.09       0.92       0.03       0.53       0.03
##  [1] -252199.55       0.43       0.34       0.21       0.02       0.08
##  [7]       0.07       0.93       0.03       0.54       0.02
##  [1] -250701.09       0.42       0.34       0.20       0.04       0.07
##  [7]       0.05       0.93       0.02       0.55       0.02
##  [1] -249255.09       0.41       0.34       0.20       0.05       0.07
##  [7]       0.04       0.93       0.02       0.55       0.01
##  [1] -248268.42       0.39       0.34       0.20       0.07       0.06
##  [7]       0.03       0.93       0.02       0.55       0.01
##  [1] -247715.74       0.38       0.34       0.20       0.08       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -247407.95       0.37       0.34       0.20       0.09       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -247216.70       0.36       0.34       0.20       0.10       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -247084.74       0.36       0.34       0.20       0.11       0.06
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -246988.48       0.35       0.34       0.20       0.11       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246916.56       0.35       0.34       0.20       0.11       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246862.17       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246820.65       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246788.64       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246763.70       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246744.05       0.34       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246728.40       0.33       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246715.78       0.33       0.34       0.20       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246705.51       0.33       0.34       0.21       0.12       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -246697.05       0.33       0.34       0.21       0.13       0.06
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268311.76       0.56       0.26       0.16       0.02       0.14
##  [7]       0.10       0.87       0.04       0.51       0.05
##  [1] -264869.59       0.60       0.24       0.13       0.02       0.15
##  [7]       0.10       0.86       0.04       0.52       0.05
##  [1] -264264.43       0.62       0.23       0.12       0.03       0.16
##  [7]       0.11       0.85       0.05       0.52       0.05
##  [1] -264075.80       0.63       0.22       0.11       0.03       0.16
##  [7]       0.11       0.84       0.05       0.53       0.05
##  [1] -264033.05       0.63       0.22       0.11       0.04       0.16
##  [7]       0.11       0.83       0.05       0.54       0.05
##  [1] -264045.28       0.63       0.21       0.11       0.04       0.16
##  [7]       0.12       0.83       0.06       0.54       0.05
##  [1] -264073.40       0.63       0.21       0.11       0.04       0.16
##  [7]       0.12       0.82       0.06       0.54       0.05
##  [1] -264100.52       0.63       0.21       0.11       0.05       0.16
##  [7]       0.12       0.82       0.06       0.54       0.05
##  [1] -264120.22       0.63       0.21       0.11       0.05       0.16
##  [7]       0.12       0.82       0.06       0.55       0.05
##  [1] -264131.03       0.62       0.21       0.11       0.05       0.16
##  [7]       0.12       0.81       0.06       0.55       0.05
##  [1] -264133.60       0.62       0.21       0.11       0.05       0.16
##  [7]       0.12       0.81       0.07       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -254974.48       0.43       0.34       0.22       0.01       0.09
##  [7]       0.08       0.92       0.04       0.53       0.03
##  [1] -252511.69       0.43       0.34       0.21       0.02       0.08
##  [7]       0.06       0.93       0.03       0.54       0.02
##  [1] -250890.99       0.42       0.34       0.20       0.03       0.08
##  [7]       0.04       0.93       0.03       0.55       0.02
##  [1] -249675.09       0.41       0.34       0.20       0.05       0.07
##  [7]       0.03       0.93       0.02       0.56       0.01
##  [1] -249019.66       0.40       0.34       0.20       0.07       0.07
##  [7]       0.03       0.93       0.02       0.56       0.01
##  [1] -248695.64       0.38       0.34       0.20       0.08       0.07
##  [7]       0.02       0.93       0.02       0.56       0.01
##  [1] -248505.23       0.37       0.34       0.20       0.09       0.07
##  [7]       0.02       0.93       0.02       0.56       0.01
##  [1] -248368.00       0.36       0.34       0.20       0.10       0.07
##  [7]       0.02       0.94       0.02       0.56       0.01
##  [1] -248260.60       0.36       0.34       0.20       0.10       0.07
##  [7]       0.02       0.94       0.02       0.56       0.01
##  [1] -248176.03       0.35       0.34       0.20       0.11       0.07
##  [7]       0.02       0.94       0.02       0.56       0.02
##  [1] -248110.23       0.35       0.34       0.20       0.11       0.07
##  [7]       0.02       0.94       0.02       0.56       0.02
##  [1] -248059.55       0.34       0.34       0.20       0.11       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -248020.73       0.34       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247991.03       0.34       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247968.26       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247950.76       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247937.26       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247926.81       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] -247918.69       0.33       0.34       0.21       0.12       0.07
##  [7]       0.02       0.93       0.02       0.56       0.02
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268423.74       0.56       0.26       0.16       0.02       0.14
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264725.62       0.60       0.24       0.14       0.02       0.16
##  [7]       0.09       0.86       0.05       0.52       0.05
##  [1] -264166.59       0.61       0.23       0.12       0.03       0.16
##  [7]       0.10       0.85       0.05       0.52       0.05
##  [1] -263987.36       0.62       0.23       0.12       0.03       0.16
##  [7]       0.10       0.85       0.05       0.53       0.05
##  [1] -263932.07       0.63       0.22       0.12       0.04       0.17
##  [7]       0.10       0.84       0.06       0.53       0.05
##  [1] -263924.51       0.63       0.22       0.12       0.04       0.17
##  [7]       0.10       0.84       0.06       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269112.94       0.57       0.19       0.22       0.02       0.19
##  [7]       0.07       0.90       0.04       0.50       0.05
##  [1] -262769.93       0.60       0.18       0.19       0.02       0.21
##  [7]       0.06       0.90       0.05       0.51       0.05
##  [1] -262337.82       0.61       0.18       0.18       0.03       0.22
##  [7]       0.06       0.89       0.06       0.52       0.04
##  [1] -262300.57       0.61       0.18       0.18       0.04       0.22
##  [7]       0.06       0.89       0.06       0.52       0.04
##  [1] -262314.44       0.61       0.18       0.17       0.04       0.22
##  [7]       0.06       0.89       0.07       0.53       0.04
##  [1] -262327.74       0.61       0.17       0.17       0.04       0.23
##  [7]       0.06       0.89       0.07       0.53       0.04
##  [1] -262333.13       0.60       0.18       0.17       0.05       0.23
##  [7]       0.06       0.89       0.07       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268870.79       0.57       0.22       0.20       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264611.78       0.61       0.19       0.17       0.02       0.17
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -263880.92       0.63       0.18       0.17       0.03       0.18
##  [7]       0.10       0.85       0.05       0.53       0.05
##  [1] -263638.33       0.63       0.17       0.16       0.03       0.18
##  [7]       0.10       0.85       0.05       0.54       0.05
##  [1] -263565.74       0.63       0.17       0.16       0.04       0.18
##  [7]       0.11       0.84       0.05       0.54       0.05
##  [1] -263560.16       0.63       0.16       0.17       0.04       0.19
##  [7]       0.11       0.84       0.05       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266085.21       0.54       0.26       0.18       0.02       0.14
##  [7]       0.09       0.89       0.04       0.51       0.05
##  [1] -263827.11       0.58       0.24       0.16       0.02       0.15
##  [7]       0.10       0.89       0.05       0.51       0.05
##  [1] -263664.02       0.59       0.23       0.14       0.03       0.15
##  [7]       0.10       0.88       0.06       0.51       0.05
##  [1] -263675.17       0.60       0.23       0.14       0.03       0.15
##  [7]       0.11       0.88       0.06       0.52       0.04
##  [1] -263708.66       0.61       0.22       0.13       0.03       0.15
##  [7]       0.11       0.88       0.07       0.52       0.05
##  [1] -263733.79       0.61       0.22       0.13       0.04       0.15
##  [7]       0.11       0.88       0.07       0.52       0.05
##  [1] -263744.90       0.61       0.22       0.13       0.04       0.15
##  [7]       0.11       0.87       0.07       0.53       0.05
##  [1] -263743.16       0.61       0.22       0.13       0.04       0.15
##  [7]       0.11       0.87       0.07       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267783.99       0.55       0.24       0.19       0.02       0.14
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264451.58       0.59       0.22       0.17       0.02       0.16
##  [7]       0.10       0.86       0.04       0.52       0.05
##  [1] -263902.03       0.61       0.20       0.16       0.03       0.16
##  [7]       0.10       0.86       0.05       0.53       0.05
##  [1] -263734.51       0.62       0.20       0.16       0.03       0.16
##  [7]       0.11       0.85       0.05       0.53       0.05
##  [1] -263692.89       0.62       0.19       0.15       0.03       0.17
##  [7]       0.11       0.85       0.05       0.54       0.05
##  [1] -263697.11       0.62       0.19       0.16       0.04       0.17
##  [7]       0.11       0.84       0.05       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267731.20       0.56       0.23       0.19       0.02       0.15
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -264741.01       0.61       0.21       0.16       0.03       0.17
##  [7]       0.11       0.87       0.04       0.51       0.05
##  [1] -264280.40       0.63       0.19       0.15       0.03       0.18
##  [7]       0.12       0.86       0.05       0.51       0.05
##  [1] -264141.67       0.64       0.18       0.15       0.03       0.19
##  [7]       0.13       0.86       0.05       0.52       0.05
##  [1] -264103.36       0.64       0.18       0.14       0.04       0.19
##  [7]       0.13       0.85       0.05       0.52       0.05
##  [1] -264100.96       0.64       0.18       0.14       0.04       0.20
##  [7]       0.14       0.85       0.05       0.52       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269373.79       0.57       0.23       0.18       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264821.04       0.61       0.21       0.15       0.02       0.18
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -264141.75       0.63       0.20       0.14       0.03       0.19
##  [7]       0.10       0.85       0.04       0.52       0.05
##  [1] -263917.19       0.63       0.20       0.14       0.03       0.19
##  [7]       0.10       0.84       0.04       0.52       0.05
##  [1] -263834.91       0.64       0.19       0.14       0.04       0.20
##  [7]       0.11       0.84       0.05       0.52       0.05
##  [1] -263809.12       0.63       0.19       0.14       0.04       0.20
##  [7]       0.11       0.84       0.05       0.53       0.05
##  [1] -263807.02       0.63       0.19       0.14       0.04       0.21
##  [7]       0.11       0.83       0.05       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269824.44       0.58       0.22       0.18       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264469.04       0.61       0.20       0.16       0.02       0.18
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -263727.89       0.63       0.19       0.15       0.03       0.19
##  [7]       0.09       0.85       0.04       0.52       0.05
##  [1] -263495.11       0.63       0.19       0.15       0.03       0.20
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -263416.64       0.63       0.18       0.15       0.04       0.21
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -263398.92       0.63       0.18       0.15       0.04       0.21
##  [7]       0.10       0.84       0.05       0.54       0.05
##  [1] -263406.91       0.63       0.18       0.15       0.04       0.21
##  [7]       0.10       0.83       0.05       0.54       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266204.55       0.54       0.29       0.15       0.02       0.13
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -263950.82       0.58       0.28       0.12       0.03       0.14
##  [7]       0.10       0.87       0.04       0.51       0.04
##  [1] -263705.08       0.60       0.27       0.10       0.03       0.14
##  [7]       0.11       0.86       0.05       0.52       0.04
##  [1] -263667.70       0.61       0.26       0.10       0.04       0.14
##  [7]       0.11       0.86       0.05       0.52       0.04
##  [1] -263677.68       0.61       0.26       0.09       0.04       0.15
##  [7]       0.11       0.85       0.05       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267788.65       0.56       0.25       0.17       0.02       0.14
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -264614.76       0.60       0.23       0.14       0.02       0.16
##  [7]       0.10       0.86       0.04       0.51       0.05
##  [1] -264115.96       0.61       0.22       0.13       0.03       0.16
##  [7]       0.11       0.86       0.05       0.52       0.05
##  [1] -263956.11       0.62       0.22       0.13       0.03       0.17
##  [7]       0.11       0.85       0.05       0.53       0.05
##  [1] -263908.95       0.63       0.21       0.13       0.04       0.17
##  [7]       0.12       0.85       0.05       0.53       0.05
##  [1] -263905.77       0.63       0.21       0.13       0.04       0.17
##  [7]       0.12       0.84       0.06       0.53       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265331.09       0.54       0.19       0.25       0.02       0.15
##  [7]       0.10       0.89       0.04       0.51       0.05
##  [1] -263295.51       0.58       0.16       0.23       0.02       0.16
##  [7]       0.12       0.88       0.04       0.52       0.04
##  [1] -262972.47       0.60       0.14       0.23       0.03       0.17
##  [7]       0.13       0.88       0.05       0.53       0.04
##  [1] -262887.34       0.61       0.13       0.23       0.03       0.18
##  [7]       0.14       0.87       0.05       0.54       0.04
##  [1] -262885.31       0.61       0.12       0.23       0.04       0.19
##  [7]       0.15       0.87       0.06       0.54       0.04
plts_paired_order<-plts_paired[order(sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric)]

pdf(here("figs","MTAB4957_organoids_thresholding_all_samples.pdf"))
plts_paired_order
## [[1]]
## 
## [[2]]
## 
## [[3]]
## 
## [[4]]
## 
## [[5]]
## 
## [[6]]
## 
## [[7]]
## 
## [[8]]
## 
## [[9]]
## 
## [[10]]
## 
## [[11]]
## 
## [[12]]
## 
## [[13]]
## 
## [[14]]
## 
## [[15]]
## 
## [[16]]
## 
## [[17]]
## 
## [[18]]
## 
## [[19]]
## 
## [[20]]
## 
## [[21]]
## 
## [[22]]
## 
## [[23]]
## 
## [[24]]
## 
## [[25]]
## 
## [[26]]
## 
## [[27]]
## 
## [[28]]
## 
## [[29]]
## 
## [[30]]
dev.off()
## png 
##   2

Fetal Organoids

sampleinfo_organoid_fetal<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.biosource.type.=="organoid" & sampleinfo_organoid$Characteristics.developmental.stage.=="fetal stage"),]
sampleinfo_organoid_fetal<-sampleinfo_organoid_fetal[-grep("KO", sampleinfo_organoid_fetal$condition),]
MTAB_organoid_beta_fetal<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid_fetal$Assay.Name)]
identical(colnames(MTAB_organoid_beta_fetal),sampleinfo_organoid_fetal$Assay.Name)
## [1] TRUE
# ' ### PCA organoids
pca_res <- prcomp(t(MTAB_organoid_beta_fetal))
Loadings<-as.data.frame(pca_res$x)
vars <- pca_res$sdev^2
Importance<-vars/sum(vars)

meta_categorical <- sampleinfo_organoid_fetal[, c(4,8,13,17,18)]  # input column numbers in meta that contain categorical variables
meta_continuous <- sampleinfo_organoid_fetal[, c(9,21)]  # input column numbers in meta that contain continuous variables
colnames(meta_categorical) <- c("Individual", "Sample Site","Sex","Block","Sentrix ID")
colnames(meta_continuous) <- c("Age", "Passage")
meta_continuous$Age<-as.numeric(meta_continuous$Age)
meta_categorical$Block<-as.factor(meta_categorical$Block)

ord<-1:length(c(colnames(meta_categorical),colnames(meta_continuous)))
PCs_to_view<-10
suppressWarnings(heat_scree_plot(Loadings, Importance, 2.5, 2.7))

## PC vs PC plot
Loadings$Assay.Name<-rownames(Loadings)
Loadings_meta<-merge(Loadings, sampleinfo_organoid_fetal, by="Assay.Name")

Sample Site

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab("PC1 (20%)")+ylab("PC2 (13%)")+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

pc_plt<-ggplot(Loadings_meta, aes(PC1, PC2, fill=as.factor(passage.or.rescope.no_numeric)))+geom_line(aes(PC1,PC2, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab("PC1 (36%)")+ylab("PC1 (14%)")+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=c(colorRampPalette(brewer.pal(11, "Spectral"))(11), "#544791","#4a3e80", "#40366f","#221d3c"),name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

legend<-ggplot(sampleinfo_organoid_fetal, aes(as.factor(-passage.or.rescope.no_numeric), fill=as.factor(passage.or.rescope.no_numeric)))+geom_bar(color="black")+
  theme_bw()+theme(legend.position = "none", axis.text.y = element_blank(),
                   axis.title.y = element_blank(),
                   axis.ticks.y = element_blank(),
                   legend.title=element_text(size=10),
                   legend.text=element_text(size=8))+
  coord_flip()+
  scale_fill_manual(values=c(colorRampPalette(brewer.pal(11, "Spectral"))(11), "#544791","#4a3e80", "#40366f","#221d3c"),name="Passage\nNumber")+th

r <- ggplot() + theme_void()

grid.arrange(pc_plt,arrangeGrob(r,legend,r, heights=c(0.6,1.25,0.4)), ncol=2, widths=c(7,1))

Variable Beta Distribution (fetal)

Variation<-function(x) {quantile(x, c(0.9), na.rm=T)[[1]]-quantile(x, c(0.1), na.rm=T)[[1]]}
Mval<-function(beta) log2(beta/(1-beta))

MTAB4957_mval= apply(MTAB_organoid_beta_fetal, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)


ref_range_dnam<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(MTAB4957_beta_VeryVariable<-MTAB_organoid_beta_fetal[which(ref_range_dnam>=2.75),])#  28418
## [1] 28418    26
## Beta distribution plot
Beta_melted<- melt(MTAB4957_beta_VeryVariable)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,sampleinfo_organoid_fetal, by.x="ID", by.y="Assay.Name")

Beta_Plot$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot$passage.or.rescope.no_numeric, levels = c(23,21,14,12,9,7,6,5,3,2,1))

ggplot(Beta_Plot, aes(Beta,color=passage.or.rescope.no_numeric.factor))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                                       legend.title = element_text(size=10),
                                                                       legend.key.size = unit(0.7,"line"))

To view the beta distributions we will also include a line for the 11 primary fetal samples to compare each passage to primary

identical(colnames(organoid_fetal_primary),sampleinfo_fetal_primary$Assay.Name)
## [1] TRUE
MTAB4957_mval= apply(organoid_fetal_primary, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)

ref_range_dnam_fetal<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(organoid_fetal_primary_VeryVariable<-organoid_fetal_primary[rev(order(ref_range_dnam_fetal)),])
## [1] 409528     11
dim(organoid_fetal_primary_VeryVariable<-organoid_fetal_primary_VeryVariable[1:28418 ,])# same number as MTAB organoid varible
## [1] 28418    11
Beta_melted_MTAB_primary<- melt(organoid_fetal_primary_VeryVariable)
Beta_Plot_MTAB_primary<-Beta_melted_MTAB_primary[which(!(is.na(Beta_melted_MTAB_primary$value))),]
colnames(Beta_Plot_MTAB_primary)<-c("CpG","ID","Beta")
Beta_Plot_MTAB_primary<-merge(Beta_Plot_MTAB_primary,sampleinfo_fetal_primary, by.x="ID", by.y="Assay.Name")
Beta_plot_primary<-Beta_Plot_MTAB_primary[,c(1:3)]
Beta_plot_primary$passage.or.rescope.no_numeric<-0
Beta_Plot<-Beta_Plot[,c(1:3,23)]

Beta_Plot_combined<-rbind(Beta_plot_primary,Beta_Plot)

Beta_Plot_combined$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot_combined$passage.or.rescope.no_numeric, levels = c(23,21,14,12,9,7,6,5,3,2,1,0))

ggplot(Beta_Plot_combined, aes(Beta,color=as.factor(passage.or.rescope.no_numeric.factor)))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                                       legend.title = element_text(size=10),
                                                                       legend.key.size = unit(0.7,"line"))

ggsave(here("figs","MTAB4957_beta_fetal_with_primary.pdf"),width = 3.75, height = 2.5)
ggsave(here("figs/jpeg","MTAB4957_beta_fetal_with_primary.jpeg"), w=5, h=3)

Paired Samples in beta plots

sampleinfo_organoid_fetal$sample_ID<-paste(sampleinfo_organoid_fetal$Characteristics.individual., sampleinfo_organoid_fetal$Characteristics.sampling.site.)
sampleinfo_organoid_paired<-sampleinfo_organoid_fetal[which(sampleinfo_organoid_fetal$sample_ID%in%sampleinfo_organoid_fetal$sample_ID[duplicated(sampleinfo_organoid_fetal$sample_ID)]),]

MTAB4957.organoid_paired<-do.call(rbind,lapply(1:length(unique(sampleinfo_organoid_paired$sample_ID)), function(x){
  sample<-unique(sampleinfo_organoid_paired$sample_ID)[x]
  samp<-sampleinfo_organoid_paired[sampleinfo_organoid_paired$sample_ID==sample,]
  samp<-samp[order(samp$passage.or.rescope.no_numeric),]
  samp$hilo<-as.factor(samp$passage.or.rescope.no_numeric)

  if(length(levels(samp$hilo))==2){levels(samp$hilo)<-c("lower","higher")}else{
    if(length(levels(samp$hilo))==3){levels(samp$hilo)<-c("lower","higher","highest")}else{
      if(length(levels(samp$hilo))==4){levels(samp$hilo)<-c("lowest","lower","higher","highest")}else{samp$hilo<-NA}
    }
  }
  samp
}))

MTAB4957.organoid_paired<-MTAB4957.organoid_paired[which(!is.na(MTAB4957.organoid_paired$hilo)),]
MTAB4957.organoid_paired$hilo<-factor(MTAB4957.organoid_paired$hilo, c("lowest","lower","higher","highest"))

identical(colnames(MTAB4957_beta_VeryVariable), sampleinfo_organoid_fetal$Assay.Name)
## [1] TRUE
MTAB4957_beta_VeryVariable_paird<-MTAB4957_beta_VeryVariable[,which(sampleinfo_organoid_fetal$sample_ID%in%MTAB4957.organoid_paired$sample_ID)]



Beta_melted<- melt(MTAB4957_beta_VeryVariable_paird)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,MTAB4957.organoid_paired, by.x="ID", by.y="Assay.Name")


labels<-as.data.frame(tapply(MTAB4957.organoid_paired$passage.or.rescope.no_numeric, MTAB4957.organoid_paired$sample_ID, function(x) paste(x, collapse=", ")))
colnames(labels)<-"passge"
labels$sample_ID<-rownames(labels)

ggplot()+
  geom_density(aes(Beta,color=hilo, group=ID),Beta_Plot, size=0.75)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values = c ("#9ecae1","#4292c6", "#225ea8", "#081d58"), name="Relative\nPassage\nLevel within\nPatient")+facet_wrap(~sample_ID, nrow=2)+
  geom_text(aes(0.75, 2.75, label=passge), data=labels, color="grey20")+th+theme(strip.text = element_text(size = 10),
                                                                                 axis.text=element_text(size=4),
                                                                                 panel.spacing = unit(0.7, "lines"))+
  scale_x_continuous(breaks = c(0,0.5,1))

ggsave(here("figs","MTAB4957_beta_paired_fetal.pdf"),w=6, height = 3.75)
ggsave(here("figs/jpeg","MTAB4957_beta_paired_fetal.jpeg"), w=6, height = 3.75)

Thresholding trimodal samples

sampleinfo_organoid_fetal$thresholded_prior_I<-sapply(1:nrow(sampleinfo_organoid_fetal), function(x){
  passage<-sampleinfo_organoid_fetal$passage.or.rescope.no_numeric[x]
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  res$prior_I
})
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157952.80       0.56       0.28       0.14       0.02       0.14
##  [7]       0.10       0.89       0.04       0.50       0.04
##  [1] -156833.59       0.60       0.27       0.11       0.03       0.15
##  [7]       0.11       0.88       0.05       0.50       0.04
##  [1] -156790.71       0.61       0.26       0.09       0.04       0.16
##  [7]       0.12       0.88       0.06       0.50       0.04
##  [1] -156840.30       0.62       0.26       0.08       0.04       0.16
##  [7]       0.13       0.87       0.06       0.50       0.04
##  [1] -156896.56       0.62       0.25       0.07       0.05       0.17
##  [7]       0.13       0.87       0.06       0.51       0.04
##  [1] -156941.22       0.62       0.25       0.07       0.05       0.17
##  [7]       0.14       0.87       0.07       0.51       0.03
##  [1] -156971.46       0.62       0.25       0.07       0.06       0.17
##  [7]       0.14       0.87       0.07       0.51       0.04
##  [1] -156989.01       0.62       0.25       0.07       0.06       0.17
##  [7]       0.14       0.87       0.07       0.51       0.04
##  [1] -156996.69       0.62       0.25       0.06       0.07       0.17
##  [7]       0.14       0.87       0.07       0.51       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159957.90       0.58       0.16       0.24       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -156245.96       0.62       0.12       0.24       0.03       0.19
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155479.65       0.63       0.10       0.24       0.03       0.21
##  [7]       0.12       0.84       0.03       0.55       0.05
##  [1] -155229.53       0.62       0.09       0.25       0.04       0.23
##  [7]       0.13       0.83       0.04       0.56       0.05
##  [1] -155159.03       0.62       0.08       0.26       0.04       0.24
##  [7]       0.13       0.83       0.04       0.56       0.04
##  [1] -155158.76       0.61       0.08       0.26       0.05       0.25
##  [7]       0.14       0.83       0.04       0.57       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156851.65       0.52       0.33       0.14       0.02       0.13
##  [7]       0.10       0.90       0.04       0.49       0.04
##  [1] -155883.29       0.54       0.33       0.11       0.02       0.14
##  [7]       0.10       0.90       0.05       0.49       0.04
##  [1] -155955.77       0.55       0.33       0.09       0.03       0.14
##  [7]       0.11       0.90       0.06       0.49       0.04
##  [1] -156103.00       0.55       0.33       0.09       0.03       0.14
##  [7]       0.11       0.90       0.06       0.49       0.04
##  [1] -156234.08       0.55       0.33       0.08       0.04       0.15
##  [7]       0.11       0.90       0.06       0.48       0.04
##  [1] -156336.91       0.55       0.33       0.08       0.04       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156414.40       0.55       0.33       0.08       0.04       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156471.91       0.55       0.33       0.08       0.05       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156514.21       0.55       0.33       0.07       0.05       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156544.96       0.54       0.33       0.07       0.05       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156566.80       0.54       0.33       0.07       0.05       0.15
##  [7]       0.12       0.91       0.04       0.48       0.04
##  [1] -156581.56       0.54       0.33       0.07       0.06       0.15
##  [7]       0.12       0.91       0.04       0.48       0.04
##  [1] -156590.50       0.53       0.33       0.07       0.06       0.15
##  [7]       0.12       0.92       0.04       0.48       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -155944.91       0.46       0.43       0.10       0.01       0.11
##  [7]       0.08       0.89       0.04       0.48       0.05
##  [1] -154340.82       0.44       0.47       0.07       0.01       0.12
##  [7]       0.07       0.90       0.05       0.47       0.05
##  [1] -154158.94       0.44       0.49       0.06       0.02       0.12
##  [7]       0.08       0.90       0.05       0.46       0.04
##  [1] -154209.89       0.43       0.50       0.05       0.02       0.12
##  [7]       0.08       0.90       0.05       0.46       0.04
##  [1] -154316.43       0.43       0.50       0.05       0.02       0.12
##  [7]       0.08       0.90       0.04       0.46       0.04
##  [1] -154428.61       0.42       0.51       0.05       0.02       0.13
##  [7]       0.08       0.90       0.04       0.45       0.04
##  [1] -154529.96       0.42       0.51       0.05       0.02       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154615.48       0.42       0.51       0.05       0.03       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154684.35       0.41       0.51       0.05       0.03       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154737.29       0.41       0.51       0.05       0.03       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154775.57       0.41       0.52       0.05       0.03       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] -154800.67       0.40       0.52       0.05       0.03       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] -154814.12       0.40       0.52       0.05       0.04       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] -154817.44       0.40       0.52       0.05       0.04       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156833.58       0.51       0.39       0.09       0.02       0.12
##  [7]       0.09       0.88       0.04       0.49       0.04
##  [1] -155662.25       0.51       0.41       0.05       0.02       0.13
##  [7]       0.09       0.88       0.05       0.48       0.04
##  [1] -155583.43       0.51       0.42       0.04       0.03       0.13
##  [7]       0.10       0.87       0.05       0.47       0.04
##  [1] -155650.18       0.51       0.43       0.03       0.03       0.14
##  [7]       0.10       0.87       0.06       0.47       0.04
##  [1] -155738.30       0.50       0.44       0.03       0.04       0.14
##  [7]       0.11       0.87       0.06       0.47       0.03
##  [1] -155815.07       0.49       0.44       0.02       0.04       0.14
##  [7]       0.11       0.87       0.06       0.46       0.03
##  [1] -155871.96       0.49       0.45       0.02       0.05       0.14
##  [7]       0.11       0.87       0.06       0.46       0.03
##  [1] -155908.99       0.48       0.45       0.02       0.05       0.14
##  [7]       0.11       0.87       0.06       0.46       0.03
##  [1] -155929.26       0.47       0.45       0.02       0.06       0.14
##  [7]       0.12       0.87       0.06       0.46       0.03
##  [1] -155936.55       0.47       0.45       0.02       0.06       0.14
##  [7]       0.12       0.87       0.06       0.46       0.03
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157509.21       0.54       0.25       0.19       0.02       0.13
##  [7]       0.11       0.88       0.04       0.51       0.05
##  [1] -156447.22       0.59       0.22       0.17       0.03       0.14
##  [7]       0.12       0.87       0.04       0.52       0.04
##  [1] -156309.10       0.61       0.21       0.16       0.03       0.14
##  [7]       0.12       0.87       0.05       0.53       0.04
##  [1] -156309.49       0.62       0.20       0.15       0.04       0.14
##  [7]       0.13       0.86       0.05       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158735.16       0.57       0.29       0.11       0.02       0.13
##  [7]       0.11       0.87       0.04       0.50       0.05
##  [1] -157318.31       0.62       0.28       0.08       0.03       0.15
##  [7]       0.12       0.86       0.05       0.51       0.04
##  [1] -157020.94       0.63       0.27       0.06       0.04       0.15
##  [7]       0.13       0.84       0.06       0.51       0.04
##  [1] -156896.01       0.64       0.27       0.05       0.04       0.16
##  [7]       0.14       0.83       0.07       0.51       0.04
##  [1] -156839.73       0.64       0.26       0.05       0.05       0.16
##  [7]       0.14       0.81       0.07       0.51       0.04
##  [1] -156818.76       0.63       0.26       0.04       0.06       0.17
##  [7]       0.15       0.80       0.07       0.51       0.04
##  [1] -156816.96       0.63       0.26       0.04       0.06       0.17
##  [7]       0.15       0.79       0.07       0.52       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160911.83       0.60       0.22       0.16       0.02       0.15
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -157068.71       0.64       0.19       0.14       0.03       0.17
##  [7]       0.11       0.83       0.03       0.53       0.05
##  [1] -156304.49       0.66       0.17       0.14       0.03       0.18
##  [7]       0.11       0.82       0.03       0.54       0.05
##  [1] -156080.52       0.66       0.16       0.14       0.04       0.19
##  [7]       0.12       0.81       0.03       0.54       0.05
##  [1] -156045.71       0.65       0.16       0.14       0.05       0.19
##  [7]       0.13       0.80       0.03       0.55       0.05
##  [1] -156076.03       0.65       0.16       0.14       0.05       0.20
##  [7]       0.13       0.80       0.04       0.55       0.05
##  [1] -156120.64       0.64       0.16       0.15       0.05       0.20
##  [7]       0.13       0.79       0.04       0.56       0.05
##  [1] -156159.66       0.63       0.16       0.15       0.06       0.20
##  [7]       0.14       0.79       0.04       0.56       0.05
##  [1] -156187.17       0.62       0.16       0.15       0.06       0.21
##  [7]       0.14       0.79       0.04       0.56       0.05
##  [1] -156203.21       0.61       0.16       0.16       0.06       0.21
##  [7]       0.14       0.79       0.04       0.56       0.05
##  [1] -156209.91       0.60       0.17       0.16       0.07       0.21
##  [7]       0.14       0.78       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -161638.23       0.62       0.19       0.16       0.02       0.17
##  [7]       0.09       0.85       0.03       0.51       0.05
##  [1] -157151.06       0.67       0.16       0.14       0.03       0.20
##  [7]       0.10       0.83       0.03       0.53       0.05
##  [1] -156228.56       0.68       0.14       0.14       0.04       0.21
##  [7]       0.11       0.82       0.03       0.54       0.05
##  [1] -155932.47       0.68       0.14       0.14       0.05       0.23
##  [7]       0.11       0.81       0.03       0.54       0.05
##  [1] -155865.39       0.67       0.13       0.14       0.05       0.24
##  [7]       0.12       0.80       0.03       0.55       0.04
##  [1] -155884.50       0.66       0.13       0.15       0.06       0.25
##  [7]       0.12       0.79       0.04       0.55       0.04
##  [1] -155928.35       0.65       0.13       0.15       0.07       0.25
##  [7]       0.12       0.79       0.04       0.56       0.04
##  [1] -155970.79       0.64       0.13       0.16       0.07       0.26
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156002.60       0.63       0.14       0.16       0.07       0.26
##  [7]       0.13       0.78       0.04       0.56       0.04
##  [1] -156022.41       0.62       0.14       0.16       0.08       0.26
##  [7]       0.13       0.78       0.04       0.56       0.05
##  [1] -156032.00       0.61       0.14       0.17       0.08       0.26
##  [7]       0.13       0.78       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159328.07       0.58       0.22       0.18       0.02       0.15
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -157270.96       0.63       0.19       0.16       0.03       0.16
##  [7]       0.11       0.86       0.05       0.53       0.05
##  [1] -156822.75       0.65       0.17       0.15       0.03       0.17
##  [7]       0.12       0.85       0.05       0.53       0.05
##  [1] -156667.50       0.66       0.16       0.15       0.04       0.18
##  [7]       0.13       0.84       0.06       0.54       0.05
##  [1] -156628.51       0.66       0.15       0.15       0.04       0.18
##  [7]       0.14       0.83       0.06       0.55       0.05
##  [1] -156636.20       0.66       0.15       0.15       0.05       0.19
##  [7]       0.14       0.83       0.06       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159121.75       0.57       0.27       0.13       0.02       0.14
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -157287.07       0.62       0.25       0.10       0.03       0.15
##  [7]       0.10       0.86       0.05       0.52       0.04
##  [1] -156927.53       0.64       0.24       0.09       0.03       0.15
##  [7]       0.11       0.84       0.06       0.52       0.04
##  [1] -156795.47       0.65       0.23       0.08       0.04       0.16
##  [7]       0.12       0.83       0.06       0.53       0.04
##  [1] -156752.57       0.65       0.23       0.08       0.05       0.16
##  [7]       0.12       0.82       0.07       0.53       0.04
##  [1] -156748.57       0.65       0.23       0.07       0.05       0.16
##  [7]       0.12       0.81       0.07       0.54       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158970.73       0.57       0.17       0.24       0.02       0.16
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155944.77       0.60       0.14       0.24       0.02       0.18
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155446.62       0.61       0.12       0.24       0.03       0.20
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155283.74       0.61       0.11       0.24       0.03       0.21
##  [7]       0.12       0.85       0.04       0.55       0.04
##  [1] -155234.20       0.61       0.11       0.24       0.04       0.21
##  [7]       0.13       0.84       0.04       0.56       0.04
##  [1] -155231.43       0.61       0.10       0.25       0.04       0.22
##  [7]       0.13       0.84       0.04       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160493.51       0.60       0.20       0.18       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156915.39       0.64       0.16       0.17       0.03       0.18
##  [7]       0.11       0.84       0.03       0.53       0.05
##  [1] -156233.18       0.66       0.14       0.16       0.04       0.20
##  [7]       0.12       0.83       0.03       0.54       0.04
##  [1] -156012.04       0.66       0.14       0.16       0.04       0.21
##  [7]       0.12       0.82       0.04       0.54       0.04
##  [1] -155955.34       0.66       0.13       0.17       0.05       0.22
##  [7]       0.13       0.82       0.04       0.55       0.04
##  [1] -155961.94       0.65       0.13       0.17       0.05       0.22
##  [7]       0.13       0.81       0.04       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157985.66       0.55       0.15       0.29       0.02       0.17
##  [7]       0.10       0.88       0.03       0.52       0.05
##  [1] -155299.24       0.57       0.11       0.29       0.02       0.19
##  [7]       0.11       0.87       0.03       0.53       0.05
##  [1] -154836.67       0.58       0.10       0.30       0.03       0.21
##  [7]       0.12       0.86       0.03       0.54       0.05
##  [1] -154674.82       0.58       0.09       0.30       0.03       0.23
##  [7]       0.12       0.86       0.04       0.55       0.05
##  [1] -154618.80       0.58       0.08       0.31       0.04       0.24
##  [7]       0.13       0.85       0.04       0.55       0.05
##  [1] -154608.82       0.57       0.08       0.31       0.04       0.25
##  [7]       0.14       0.85       0.04       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160561.43       0.60       0.20       0.18       0.02       0.16
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -156977.58       0.64       0.17       0.17       0.03       0.19
##  [7]       0.10       0.85       0.03       0.52       0.05
##  [1] -156307.57       0.65       0.15       0.16       0.03       0.20
##  [7]       0.11       0.83       0.04       0.53       0.05
##  [1] -156095.62       0.66       0.14       0.16       0.04       0.21
##  [7]       0.12       0.82       0.04       0.54       0.05
##  [1] -156041.74       0.65       0.14       0.16       0.04       0.22
##  [7]       0.12       0.82       0.04       0.55       0.05
##  [1] -156046.58       0.65       0.13       0.17       0.05       0.22
##  [7]       0.13       0.81       0.04       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158513.30       0.55       0.18       0.25       0.02       0.16
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155730.90       0.59       0.15       0.24       0.02       0.17
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155309.77       0.60       0.13       0.24       0.03       0.19
##  [7]       0.12       0.86       0.03       0.54       0.05
##  [1] -155174.71       0.60       0.12       0.25       0.03       0.19
##  [7]       0.12       0.85       0.03       0.55       0.05
##  [1] -155134.73       0.60       0.12       0.25       0.04       0.20
##  [7]       0.13       0.85       0.04       0.55       0.05
##  [1] -155134.08       0.60       0.11       0.25       0.04       0.21
##  [7]       0.13       0.85       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158305.37       0.55       0.16       0.27       0.02       0.16
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155475.57       0.58       0.12       0.27       0.02       0.19
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155024.67       0.59       0.11       0.27       0.03       0.20
##  [7]       0.12       0.86       0.03       0.54       0.05
##  [1] -154871.25       0.59       0.10       0.27       0.03       0.22
##  [7]       0.13       0.85       0.03       0.54       0.05
##  [1] -154818.39       0.59       0.09       0.28       0.04       0.23
##  [7]       0.14       0.85       0.04       0.55       0.05
##  [1] -154808.34       0.59       0.09       0.28       0.04       0.24
##  [7]       0.15       0.85       0.04       0.55       0.05
##  [1] -154816.04       0.58       0.09       0.28       0.05       0.24
##  [7]       0.15       0.85       0.04       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159623.23       0.58       0.17       0.23       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -156433.23       0.62       0.13       0.22       0.03       0.19
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155803.37       0.63       0.12       0.22       0.03       0.21
##  [7]       0.12       0.85       0.04       0.54       0.05
##  [1] -155575.47       0.64       0.11       0.22       0.04       0.22
##  [7]       0.12       0.84       0.04       0.55       0.05
##  [1] -155500.97       0.63       0.10       0.22       0.04       0.24
##  [7]       0.13       0.84       0.04       0.56       0.05
##  [1] -155492.92       0.63       0.10       0.23       0.05       0.25
##  [7]       0.13       0.83       0.05       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158766.69       0.56       0.16       0.26       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155655.89       0.59       0.12       0.26       0.02       0.19
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155129.24       0.60       0.10       0.26       0.03       0.21
##  [7]       0.12       0.85       0.03       0.54       0.05
##  [1] -154945.49       0.60       0.10       0.27       0.04       0.23
##  [7]       0.13       0.85       0.03       0.55       0.05
##  [1] -154883.58       0.60       0.09       0.27       0.04       0.24
##  [7]       0.14       0.85       0.04       0.55       0.05
##  [1] -154874.84       0.59       0.09       0.27       0.04       0.25
##  [7]       0.14       0.84       0.04       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160347.69       0.59       0.18       0.21       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156640.87       0.63       0.14       0.20       0.03       0.18
##  [7]       0.11       0.84       0.03       0.53       0.05
##  [1] -155891.20       0.64       0.13       0.21       0.03       0.20
##  [7]       0.12       0.83       0.03       0.54       0.05
##  [1] -155664.02       0.64       0.12       0.21       0.04       0.21
##  [7]       0.13       0.83       0.03       0.55       0.05
##  [1] -155610.24       0.64       0.11       0.21       0.04       0.22
##  [7]       0.14       0.82       0.04       0.55       0.05
##  [1] -155616.55       0.63       0.11       0.22       0.04       0.22
##  [7]       0.14       0.82       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160298.78       0.59       0.18       0.22       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156360.09       0.62       0.14       0.21       0.03       0.18
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155596.90       0.63       0.12       0.22       0.03       0.19
##  [7]       0.11       0.83       0.03       0.55       0.05
##  [1] -155368.14       0.63       0.11       0.22       0.04       0.20
##  [7]       0.12       0.83       0.04       0.56       0.05
##  [1] -155322.88       0.63       0.10       0.23       0.04       0.21
##  [7]       0.13       0.82       0.04       0.57       0.04
##  [1] -155342.87       0.62       0.10       0.23       0.05       0.21
##  [7]       0.13       0.82       0.04       0.57       0.04
##  [1] -155380.85       0.61       0.10       0.24       0.05       0.22
##  [7]       0.13       0.82       0.04       0.58       0.04
##  [1] -155418.05       0.60       0.10       0.24       0.05       0.22
##  [7]       0.14       0.81       0.04       0.58       0.04
##  [1] -155448.12       0.60       0.10       0.25       0.06       0.22
##  [7]       0.14       0.81       0.04       0.58       0.04
##  [1] -155470.00       0.59       0.10       0.25       0.06       0.22
##  [7]       0.14       0.81       0.05       0.58       0.04
##  [1] -155484.68       0.58       0.10       0.25       0.06       0.23
##  [7]       0.14       0.81       0.05       0.58       0.04
##  [1] -155493.69       0.57       0.11       0.26       0.06       0.23
##  [7]       0.14       0.81       0.05       0.58       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160906.11       0.60       0.21       0.17       0.02       0.16
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -157285.13       0.65       0.18       0.15       0.03       0.18
##  [7]       0.10       0.84       0.04       0.53       0.05
##  [1] -156526.19       0.66       0.16       0.14       0.03       0.19
##  [7]       0.10       0.83       0.04       0.54       0.05
##  [1] -156276.29       0.67       0.15       0.14       0.04       0.20
##  [7]       0.11       0.82       0.04       0.55       0.05
##  [1] -156222.17       0.66       0.15       0.14       0.05       0.21
##  [7]       0.11       0.81       0.04       0.55       0.05
##  [1] -156243.48       0.66       0.14       0.15       0.05       0.21
##  [7]       0.12       0.80       0.05       0.56       0.05
##  [1] -156286.02       0.65       0.14       0.15       0.05       0.21
##  [7]       0.12       0.80       0.05       0.56       0.05
##  [1] -156326.44       0.65       0.14       0.15       0.06       0.21
##  [7]       0.12       0.79       0.05       0.56       0.05
##  [1] -156356.54       0.64       0.14       0.16       0.06       0.22
##  [7]       0.12       0.79       0.05       0.57       0.05
##  [1] -156375.14       0.63       0.15       0.16       0.06       0.22
##  [7]       0.12       0.79       0.05       0.57       0.05
##  [1] -156383.90       0.63       0.15       0.16       0.06       0.22
##  [7]       0.12       0.79       0.05       0.57       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160598.48       0.59       0.23       0.15       0.02       0.15
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156902.56       0.63       0.21       0.13       0.03       0.16
##  [7]       0.10       0.83       0.03       0.53       0.05
##  [1] -156204.76       0.65       0.19       0.13       0.03       0.17
##  [7]       0.11       0.82       0.03       0.54       0.05
##  [1] -156016.85       0.65       0.18       0.13       0.04       0.17
##  [7]       0.12       0.81       0.03       0.55       0.04
##  [1] -156002.00       0.64       0.18       0.13       0.05       0.18
##  [7]       0.12       0.80       0.03       0.55       0.04
##  [1] -156043.34       0.64       0.18       0.14       0.05       0.18
##  [7]       0.12       0.80       0.04       0.56       0.04
##  [1] -156093.86       0.63       0.18       0.14       0.05       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156135.71       0.62       0.18       0.14       0.06       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156164.05       0.61       0.18       0.15       0.06       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156179.47       0.60       0.18       0.15       0.07       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156184.52       0.59       0.19       0.15       0.07       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157324.85       0.52       0.32       0.14       0.02       0.13
##  [7]       0.09       0.89       0.04       0.50       0.05
##  [1] -155979.56       0.55       0.32       0.11       0.02       0.14
##  [7]       0.09       0.89       0.05       0.50       0.04
##  [1] -155946.33       0.56       0.32       0.09       0.03       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] -156007.14       0.56       0.32       0.08       0.03       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] -156064.73       0.57       0.32       0.08       0.04       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] -156103.51       0.57       0.32       0.08       0.04       0.14
##  [7]       0.10       0.89       0.06       0.50       0.04
##  [1] -156123.37       0.57       0.32       0.07       0.04       0.14
##  [7]       0.10       0.89       0.06       0.50       0.04
##  [1] -156127.64       0.56       0.32       0.07       0.05       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160447.86       0.60       0.27       0.11       0.02       0.15
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -157444.39       0.64       0.25       0.08       0.03       0.16
##  [7]       0.10       0.84       0.04       0.52       0.05
##  [1] -156810.33       0.65       0.24       0.07       0.04       0.17
##  [7]       0.10       0.82       0.04       0.53       0.04
##  [1] -156576.12       0.65       0.24       0.07       0.04       0.17
##  [7]       0.11       0.80       0.05       0.53       0.04
##  [1] -156520.00       0.65       0.23       0.07       0.05       0.17
##  [7]       0.11       0.79       0.05       0.54       0.04
##  [1] -156549.47       0.64       0.23       0.07       0.06       0.18
##  [7]       0.11       0.78       0.05       0.54       0.04
##  [1] -156613.32       0.63       0.24       0.07       0.06       0.18
##  [7]       0.11       0.77       0.05       0.55       0.04
##  [1] -156683.18       0.63       0.24       0.07       0.07       0.18
##  [7]       0.12       0.76       0.05       0.55       0.04
##  [1] -156744.78       0.62       0.24       0.07       0.07       0.18
##  [7]       0.12       0.76       0.05       0.55       0.04
##  [1] -156792.31       0.61       0.24       0.07       0.07       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] -156824.64       0.60       0.25       0.08       0.08       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] -156842.99       0.59       0.25       0.08       0.08       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] -156849.50       0.58       0.25       0.08       0.08       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159355.88       0.57       0.25       0.15       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -157295.65       0.62       0.23       0.12       0.03       0.16
##  [7]       0.10       0.86       0.05       0.52       0.04
##  [1] -156950.46       0.64       0.22       0.11       0.03       0.17
##  [7]       0.11       0.85       0.06       0.52       0.04
##  [1] -156835.71       0.65       0.21       0.10       0.04       0.17
##  [7]       0.11       0.84       0.06       0.53       0.04
##  [1] -156802.05       0.65       0.21       0.10       0.04       0.17
##  [7]       0.12       0.84       0.07       0.53       0.04
##  [1] -156800.34       0.65       0.20       0.10       0.05       0.17
##  [7]       0.12       0.83       0.07       0.53       0.04
ggplot(sampleinfo_organoid_fetal, aes(as.numeric(as.character(passage.or.rescope.no_numeric)), thresholded_prior_I))+
  geom_point(size=2,shape=21,color="black",aes(fill=as.factor(passage.or.rescope.no_numeric)))+xlab("Passage")+
  ylab("Intermediate Peak Prior")+theme_bw()+theme(axis.title = element_text(size=12))+
  #geom_text(aes(label=count, vjust=vjust, hjust=hjust), color="grey40", size=3)+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_fetal_mixture_model_prior_I.pdf"), width=3, height=2)


sampleinfo_organoid_fetal$thresholded_prior10<-F
sampleinfo_organoid_fetal$thresholded_prior10[which(sampleinfo_organoid_fetal$thresholded_prior_I>0.10)]<-T

percent_passing<-round((tapply(sampleinfo_organoid_fetal$thresholded_prior10, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, sum)/tapply(sampleinfo_organoid_fetal$array.id, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, length))*100,2)
passed_num<-tapply(sampleinfo_organoid_fetal$thresholded_prior10, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, sum)
org_numer<-tapply(sampleinfo_organoid_fetal$array.id, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, length)

df<-data.frame(passage=names(percent_passing), passing=percent_passing, pro_passing=percent_passing/100, count=org_numer, passed_num=passed_num)
df$passage.factor <- factor(df$passage, levels = c(23,21,14,12,9,7,6,5,3,2,1))


df<-cbind(df,(binom.confint(df$passed_num, df$count, method="exact", conf.level=0.95)))
df$upper<-df$upper*100
df$lower<-df$lower*100

ggplot(df, aes(as.numeric(as.character(passage)), passing))+
  geom_errorbar(aes(ymin=lower, ymax=upper), colour="grey70", width=.25)+
  geom_line(color="grey20")+geom_point(size=1.25,shape=21,color="black",aes(fill=passage.factor))+xlab("Passage")+
  ylab("Samples with Trimodal\nDistribution (%)")+theme_bw()+theme(axis.title = element_text(size=10))+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_fetal_mixture_model_prior_I_threshold.pdf"), width=3, height=2)


## plot all samples
plts_paired<-lapply(1:nrow(sampleinfo_organoid_fetal), function(x){
  passage<-paste("passage: ",sampleinfo_organoid_fetal$passage.or.rescope.no_numeric[x],"\nIndividual: ", sampleinfo_organoid_fetal$Characteristics.individual.[x],"\nPrior I: " ,round(sampleinfo_organoid_fetal$thresholded_prior_I[x],2), sep="")
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  draw_fit_params_gg(converted, counts, res,passage)
})
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157952.80       0.56       0.28       0.14       0.02       0.14
##  [7]       0.10       0.89       0.04       0.50       0.04
##  [1] -156833.59       0.60       0.27       0.11       0.03       0.15
##  [7]       0.11       0.88       0.05       0.50       0.04
##  [1] -156790.71       0.61       0.26       0.09       0.04       0.16
##  [7]       0.12       0.88       0.06       0.50       0.04
##  [1] -156840.30       0.62       0.26       0.08       0.04       0.16
##  [7]       0.13       0.87       0.06       0.50       0.04
##  [1] -156896.56       0.62       0.25       0.07       0.05       0.17
##  [7]       0.13       0.87       0.06       0.51       0.04
##  [1] -156941.22       0.62       0.25       0.07       0.05       0.17
##  [7]       0.14       0.87       0.07       0.51       0.03
##  [1] -156971.46       0.62       0.25       0.07       0.06       0.17
##  [7]       0.14       0.87       0.07       0.51       0.04
##  [1] -156989.01       0.62       0.25       0.07       0.06       0.17
##  [7]       0.14       0.87       0.07       0.51       0.04
##  [1] -156996.69       0.62       0.25       0.06       0.07       0.17
##  [7]       0.14       0.87       0.07       0.51       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159957.90       0.58       0.16       0.24       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -156245.96       0.62       0.12       0.24       0.03       0.19
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155479.65       0.63       0.10       0.24       0.03       0.21
##  [7]       0.12       0.84       0.03       0.55       0.05
##  [1] -155229.53       0.62       0.09       0.25       0.04       0.23
##  [7]       0.13       0.83       0.04       0.56       0.05
##  [1] -155159.03       0.62       0.08       0.26       0.04       0.24
##  [7]       0.13       0.83       0.04       0.56       0.04
##  [1] -155158.76       0.61       0.08       0.26       0.05       0.25
##  [7]       0.14       0.83       0.04       0.57       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156851.65       0.52       0.33       0.14       0.02       0.13
##  [7]       0.10       0.90       0.04       0.49       0.04
##  [1] -155883.29       0.54       0.33       0.11       0.02       0.14
##  [7]       0.10       0.90       0.05       0.49       0.04
##  [1] -155955.77       0.55       0.33       0.09       0.03       0.14
##  [7]       0.11       0.90       0.06       0.49       0.04
##  [1] -156103.00       0.55       0.33       0.09       0.03       0.14
##  [7]       0.11       0.90       0.06       0.49       0.04
##  [1] -156234.08       0.55       0.33       0.08       0.04       0.15
##  [7]       0.11       0.90       0.06       0.48       0.04
##  [1] -156336.91       0.55       0.33       0.08       0.04       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156414.40       0.55       0.33       0.08       0.04       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156471.91       0.55       0.33       0.08       0.05       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156514.21       0.55       0.33       0.07       0.05       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156544.96       0.54       0.33       0.07       0.05       0.15
##  [7]       0.12       0.91       0.05       0.48       0.04
##  [1] -156566.80       0.54       0.33       0.07       0.05       0.15
##  [7]       0.12       0.91       0.04       0.48       0.04
##  [1] -156581.56       0.54       0.33       0.07       0.06       0.15
##  [7]       0.12       0.91       0.04       0.48       0.04
##  [1] -156590.50       0.53       0.33       0.07       0.06       0.15
##  [7]       0.12       0.92       0.04       0.48       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -155944.91       0.46       0.43       0.10       0.01       0.11
##  [7]       0.08       0.89       0.04       0.48       0.05
##  [1] -154340.82       0.44       0.47       0.07       0.01       0.12
##  [7]       0.07       0.90       0.05       0.47       0.05
##  [1] -154158.94       0.44       0.49       0.06       0.02       0.12
##  [7]       0.08       0.90       0.05       0.46       0.04
##  [1] -154209.89       0.43       0.50       0.05       0.02       0.12
##  [7]       0.08       0.90       0.05       0.46       0.04
##  [1] -154316.43       0.43       0.50       0.05       0.02       0.12
##  [7]       0.08       0.90       0.04       0.46       0.04
##  [1] -154428.61       0.42       0.51       0.05       0.02       0.13
##  [7]       0.08       0.90       0.04       0.45       0.04
##  [1] -154529.96       0.42       0.51       0.05       0.02       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154615.48       0.42       0.51       0.05       0.03       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154684.35       0.41       0.51       0.05       0.03       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154737.29       0.41       0.51       0.05       0.03       0.13
##  [7]       0.08       0.91       0.04       0.45       0.04
##  [1] -154775.57       0.41       0.52       0.05       0.03       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] -154800.67       0.40       0.52       0.05       0.03       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] -154814.12       0.40       0.52       0.05       0.04       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] -154817.44       0.40       0.52       0.05       0.04       0.13
##  [7]       0.08       0.91       0.03       0.45       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156833.58       0.51       0.39       0.09       0.02       0.12
##  [7]       0.09       0.88       0.04       0.49       0.04
##  [1] -155662.25       0.51       0.41       0.05       0.02       0.13
##  [7]       0.09       0.88       0.05       0.48       0.04
##  [1] -155583.43       0.51       0.42       0.04       0.03       0.13
##  [7]       0.10       0.87       0.05       0.47       0.04
##  [1] -155650.18       0.51       0.43       0.03       0.03       0.14
##  [7]       0.10       0.87       0.06       0.47       0.04
##  [1] -155738.30       0.50       0.44       0.03       0.04       0.14
##  [7]       0.11       0.87       0.06       0.47       0.03
##  [1] -155815.07       0.49       0.44       0.02       0.04       0.14
##  [7]       0.11       0.87       0.06       0.46       0.03
##  [1] -155871.96       0.49       0.45       0.02       0.05       0.14
##  [7]       0.11       0.87       0.06       0.46       0.03
##  [1] -155908.99       0.48       0.45       0.02       0.05       0.14
##  [7]       0.11       0.87       0.06       0.46       0.03
##  [1] -155929.26       0.47       0.45       0.02       0.06       0.14
##  [7]       0.12       0.87       0.06       0.46       0.03
##  [1] -155936.55       0.47       0.45       0.02       0.06       0.14
##  [7]       0.12       0.87       0.06       0.46       0.03
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157509.21       0.54       0.25       0.19       0.02       0.13
##  [7]       0.11       0.88       0.04       0.51       0.05
##  [1] -156447.22       0.59       0.22       0.17       0.03       0.14
##  [7]       0.12       0.87       0.04       0.52       0.04
##  [1] -156309.10       0.61       0.21       0.16       0.03       0.14
##  [7]       0.12       0.87       0.05       0.53       0.04
##  [1] -156309.49       0.62       0.20       0.15       0.04       0.14
##  [7]       0.13       0.86       0.05       0.53       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158735.16       0.57       0.29       0.11       0.02       0.13
##  [7]       0.11       0.87       0.04       0.50       0.05
##  [1] -157318.31       0.62       0.28       0.08       0.03       0.15
##  [7]       0.12       0.86       0.05       0.51       0.04
##  [1] -157020.94       0.63       0.27       0.06       0.04       0.15
##  [7]       0.13       0.84       0.06       0.51       0.04
##  [1] -156896.01       0.64       0.27       0.05       0.04       0.16
##  [7]       0.14       0.83       0.07       0.51       0.04
##  [1] -156839.73       0.64       0.26       0.05       0.05       0.16
##  [7]       0.14       0.81       0.07       0.51       0.04
##  [1] -156818.76       0.63       0.26       0.04       0.06       0.17
##  [7]       0.15       0.80       0.07       0.51       0.04
##  [1] -156816.96       0.63       0.26       0.04       0.06       0.17
##  [7]       0.15       0.79       0.07       0.52       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160911.83       0.60       0.22       0.16       0.02       0.15
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -157068.71       0.64       0.19       0.14       0.03       0.17
##  [7]       0.11       0.83       0.03       0.53       0.05
##  [1] -156304.49       0.66       0.17       0.14       0.03       0.18
##  [7]       0.11       0.82       0.03       0.54       0.05
##  [1] -156080.52       0.66       0.16       0.14       0.04       0.19
##  [7]       0.12       0.81       0.03       0.54       0.05
##  [1] -156045.71       0.65       0.16       0.14       0.05       0.19
##  [7]       0.13       0.80       0.03       0.55       0.05
##  [1] -156076.03       0.65       0.16       0.14       0.05       0.20
##  [7]       0.13       0.80       0.04       0.55       0.05
##  [1] -156120.64       0.64       0.16       0.15       0.05       0.20
##  [7]       0.13       0.79       0.04       0.56       0.05
##  [1] -156159.66       0.63       0.16       0.15       0.06       0.20
##  [7]       0.14       0.79       0.04       0.56       0.05
##  [1] -156187.17       0.62       0.16       0.15       0.06       0.21
##  [7]       0.14       0.79       0.04       0.56       0.05
##  [1] -156203.21       0.61       0.16       0.16       0.06       0.21
##  [7]       0.14       0.79       0.04       0.56       0.05
##  [1] -156209.91       0.60       0.17       0.16       0.07       0.21
##  [7]       0.14       0.78       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -161638.23       0.62       0.19       0.16       0.02       0.17
##  [7]       0.09       0.85       0.03       0.51       0.05
##  [1] -157151.06       0.67       0.16       0.14       0.03       0.20
##  [7]       0.10       0.83       0.03       0.53       0.05
##  [1] -156228.56       0.68       0.14       0.14       0.04       0.21
##  [7]       0.11       0.82       0.03       0.54       0.05
##  [1] -155932.47       0.68       0.14       0.14       0.05       0.23
##  [7]       0.11       0.81       0.03       0.54       0.05
##  [1] -155865.39       0.67       0.13       0.14       0.05       0.24
##  [7]       0.12       0.80       0.03       0.55       0.04
##  [1] -155884.50       0.66       0.13       0.15       0.06       0.25
##  [7]       0.12       0.79       0.04       0.55       0.04
##  [1] -155928.35       0.65       0.13       0.15       0.07       0.25
##  [7]       0.12       0.79       0.04       0.56       0.04
##  [1] -155970.79       0.64       0.13       0.16       0.07       0.26
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156002.60       0.63       0.14       0.16       0.07       0.26
##  [7]       0.13       0.78       0.04       0.56       0.04
##  [1] -156022.41       0.62       0.14       0.16       0.08       0.26
##  [7]       0.13       0.78       0.04       0.56       0.05
##  [1] -156032.00       0.61       0.14       0.17       0.08       0.26
##  [7]       0.13       0.78       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159328.07       0.58       0.22       0.18       0.02       0.15
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -157270.96       0.63       0.19       0.16       0.03       0.16
##  [7]       0.11       0.86       0.05       0.53       0.05
##  [1] -156822.75       0.65       0.17       0.15       0.03       0.17
##  [7]       0.12       0.85       0.05       0.53       0.05
##  [1] -156667.50       0.66       0.16       0.15       0.04       0.18
##  [7]       0.13       0.84       0.06       0.54       0.05
##  [1] -156628.51       0.66       0.15       0.15       0.04       0.18
##  [7]       0.14       0.83       0.06       0.55       0.05
##  [1] -156636.20       0.66       0.15       0.15       0.05       0.19
##  [7]       0.14       0.83       0.06       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159121.75       0.57       0.27       0.13       0.02       0.14
##  [7]       0.10       0.88       0.04       0.51       0.05
##  [1] -157287.07       0.62       0.25       0.10       0.03       0.15
##  [7]       0.10       0.86       0.05       0.52       0.04
##  [1] -156927.53       0.64       0.24       0.09       0.03       0.15
##  [7]       0.11       0.84       0.06       0.52       0.04
##  [1] -156795.47       0.65       0.23       0.08       0.04       0.16
##  [7]       0.12       0.83       0.06       0.53       0.04
##  [1] -156752.57       0.65       0.23       0.08       0.05       0.16
##  [7]       0.12       0.82       0.07       0.53       0.04
##  [1] -156748.57       0.65       0.23       0.07       0.05       0.16
##  [7]       0.12       0.81       0.07       0.54       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158970.73       0.57       0.17       0.24       0.02       0.16
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155944.77       0.60       0.14       0.24       0.02       0.18
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155446.62       0.61       0.12       0.24       0.03       0.20
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155283.74       0.61       0.11       0.24       0.03       0.21
##  [7]       0.12       0.85       0.04       0.55       0.04
##  [1] -155234.20       0.61       0.11       0.24       0.04       0.21
##  [7]       0.13       0.84       0.04       0.56       0.04
##  [1] -155231.43       0.61       0.10       0.25       0.04       0.22
##  [7]       0.13       0.84       0.04       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160493.51       0.60       0.20       0.18       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156915.39       0.64       0.16       0.17       0.03       0.18
##  [7]       0.11       0.84       0.03       0.53       0.05
##  [1] -156233.18       0.66       0.14       0.16       0.04       0.20
##  [7]       0.12       0.83       0.03       0.54       0.04
##  [1] -156012.04       0.66       0.14       0.16       0.04       0.21
##  [7]       0.12       0.82       0.04       0.54       0.04
##  [1] -155955.34       0.66       0.13       0.17       0.05       0.22
##  [7]       0.13       0.82       0.04       0.55       0.04
##  [1] -155961.94       0.65       0.13       0.17       0.05       0.22
##  [7]       0.13       0.81       0.04       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157985.66       0.55       0.15       0.29       0.02       0.17
##  [7]       0.10       0.88       0.03       0.52       0.05
##  [1] -155299.24       0.57       0.11       0.29       0.02       0.19
##  [7]       0.11       0.87       0.03       0.53       0.05
##  [1] -154836.67       0.58       0.10       0.30       0.03       0.21
##  [7]       0.12       0.86       0.03       0.54       0.05
##  [1] -154674.82       0.58       0.09       0.30       0.03       0.23
##  [7]       0.12       0.86       0.04       0.55       0.05
##  [1] -154618.80       0.58       0.08       0.31       0.04       0.24
##  [7]       0.13       0.85       0.04       0.55       0.05
##  [1] -154608.82       0.57       0.08       0.31       0.04       0.25
##  [7]       0.14       0.85       0.04       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160561.43       0.60       0.20       0.18       0.02       0.16
##  [7]       0.10       0.86       0.03       0.51       0.05
##  [1] -156977.58       0.64       0.17       0.17       0.03       0.19
##  [7]       0.10       0.85       0.03       0.52       0.05
##  [1] -156307.57       0.65       0.15       0.16       0.03       0.20
##  [7]       0.11       0.83       0.04       0.53       0.05
##  [1] -156095.62       0.66       0.14       0.16       0.04       0.21
##  [7]       0.12       0.82       0.04       0.54       0.05
##  [1] -156041.74       0.65       0.14       0.16       0.04       0.22
##  [7]       0.12       0.82       0.04       0.55       0.05
##  [1] -156046.58       0.65       0.13       0.17       0.05       0.22
##  [7]       0.13       0.81       0.04       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158513.30       0.55       0.18       0.25       0.02       0.16
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155730.90       0.59       0.15       0.24       0.02       0.17
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155309.77       0.60       0.13       0.24       0.03       0.19
##  [7]       0.12       0.86       0.03       0.54       0.05
##  [1] -155174.71       0.60       0.12       0.25       0.03       0.19
##  [7]       0.12       0.85       0.03       0.55       0.05
##  [1] -155134.73       0.60       0.12       0.25       0.04       0.20
##  [7]       0.13       0.85       0.04       0.55       0.05
##  [1] -155134.08       0.60       0.11       0.25       0.04       0.21
##  [7]       0.13       0.85       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158305.37       0.55       0.16       0.27       0.02       0.16
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155475.57       0.58       0.12       0.27       0.02       0.19
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155024.67       0.59       0.11       0.27       0.03       0.20
##  [7]       0.12       0.86       0.03       0.54       0.05
##  [1] -154871.25       0.59       0.10       0.27       0.03       0.22
##  [7]       0.13       0.85       0.03       0.54       0.05
##  [1] -154818.39       0.59       0.09       0.28       0.04       0.23
##  [7]       0.14       0.85       0.04       0.55       0.05
##  [1] -154808.34       0.59       0.09       0.28       0.04       0.24
##  [7]       0.15       0.85       0.04       0.55       0.05
##  [1] -154816.04       0.58       0.09       0.28       0.05       0.24
##  [7]       0.15       0.85       0.04       0.55       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159623.23       0.58       0.17       0.23       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -156433.23       0.62       0.13       0.22       0.03       0.19
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155803.37       0.63       0.12       0.22       0.03       0.21
##  [7]       0.12       0.85       0.04       0.54       0.05
##  [1] -155575.47       0.64       0.11       0.22       0.04       0.22
##  [7]       0.12       0.84       0.04       0.55       0.05
##  [1] -155500.97       0.63       0.10       0.22       0.04       0.24
##  [7]       0.13       0.84       0.04       0.56       0.05
##  [1] -155492.92       0.63       0.10       0.23       0.05       0.25
##  [7]       0.13       0.83       0.05       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158766.69       0.56       0.16       0.26       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -155655.89       0.59       0.12       0.26       0.02       0.19
##  [7]       0.11       0.86       0.03       0.53       0.05
##  [1] -155129.24       0.60       0.10       0.26       0.03       0.21
##  [7]       0.12       0.85       0.03       0.54       0.05
##  [1] -154945.49       0.60       0.10       0.27       0.04       0.23
##  [7]       0.13       0.85       0.03       0.55       0.05
##  [1] -154883.58       0.60       0.09       0.27       0.04       0.24
##  [7]       0.14       0.85       0.04       0.55       0.05
##  [1] -154874.84       0.59       0.09       0.27       0.04       0.25
##  [7]       0.14       0.84       0.04       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160347.69       0.59       0.18       0.21       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156640.87       0.63       0.14       0.20       0.03       0.18
##  [7]       0.11       0.84       0.03       0.53       0.05
##  [1] -155891.20       0.64       0.13       0.21       0.03       0.20
##  [7]       0.12       0.83       0.03       0.54       0.05
##  [1] -155664.02       0.64       0.12       0.21       0.04       0.21
##  [7]       0.13       0.83       0.03       0.55       0.05
##  [1] -155610.24       0.64       0.11       0.21       0.04       0.22
##  [7]       0.14       0.82       0.04       0.55       0.05
##  [1] -155616.55       0.63       0.11       0.22       0.04       0.22
##  [7]       0.14       0.82       0.04       0.56       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160298.78       0.59       0.18       0.22       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156360.09       0.62       0.14       0.21       0.03       0.18
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155596.90       0.63       0.12       0.22       0.03       0.19
##  [7]       0.11       0.83       0.03       0.55       0.05
##  [1] -155368.14       0.63       0.11       0.22       0.04       0.20
##  [7]       0.12       0.83       0.04       0.56       0.05
##  [1] -155322.88       0.63       0.10       0.23       0.04       0.21
##  [7]       0.13       0.82       0.04       0.57       0.04
##  [1] -155342.87       0.62       0.10       0.23       0.05       0.21
##  [7]       0.13       0.82       0.04       0.57       0.04
##  [1] -155380.85       0.61       0.10       0.24       0.05       0.22
##  [7]       0.13       0.82       0.04       0.58       0.04
##  [1] -155418.05       0.60       0.10       0.24       0.05       0.22
##  [7]       0.14       0.81       0.04       0.58       0.04
##  [1] -155448.12       0.60       0.10       0.25       0.06       0.22
##  [7]       0.14       0.81       0.04       0.58       0.04
##  [1] -155470.00       0.59       0.10       0.25       0.06       0.22
##  [7]       0.14       0.81       0.05       0.58       0.04
##  [1] -155484.68       0.58       0.10       0.25       0.06       0.23
##  [7]       0.14       0.81       0.05       0.58       0.04
##  [1] -155493.69       0.57       0.11       0.26       0.06       0.23
##  [7]       0.14       0.81       0.05       0.58       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160906.11       0.60       0.21       0.17       0.02       0.16
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -157285.13       0.65       0.18       0.15       0.03       0.18
##  [7]       0.10       0.84       0.04       0.53       0.05
##  [1] -156526.19       0.66       0.16       0.14       0.03       0.19
##  [7]       0.10       0.83       0.04       0.54       0.05
##  [1] -156276.29       0.67       0.15       0.14       0.04       0.20
##  [7]       0.11       0.82       0.04       0.55       0.05
##  [1] -156222.17       0.66       0.15       0.14       0.05       0.21
##  [7]       0.11       0.81       0.04       0.55       0.05
##  [1] -156243.48       0.66       0.14       0.15       0.05       0.21
##  [7]       0.12       0.80       0.05       0.56       0.05
##  [1] -156286.02       0.65       0.14       0.15       0.05       0.21
##  [7]       0.12       0.80       0.05       0.56       0.05
##  [1] -156326.44       0.65       0.14       0.15       0.06       0.21
##  [7]       0.12       0.79       0.05       0.56       0.05
##  [1] -156356.54       0.64       0.14       0.16       0.06       0.22
##  [7]       0.12       0.79       0.05       0.57       0.05
##  [1] -156375.14       0.63       0.15       0.16       0.06       0.22
##  [7]       0.12       0.79       0.05       0.57       0.05
##  [1] -156383.90       0.63       0.15       0.16       0.06       0.22
##  [7]       0.12       0.79       0.05       0.57       0.05
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160598.48       0.59       0.23       0.15       0.02       0.15
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156902.56       0.63       0.21       0.13       0.03       0.16
##  [7]       0.10       0.83       0.03       0.53       0.05
##  [1] -156204.76       0.65       0.19       0.13       0.03       0.17
##  [7]       0.11       0.82       0.03       0.54       0.05
##  [1] -156016.85       0.65       0.18       0.13       0.04       0.17
##  [7]       0.12       0.81       0.03       0.55       0.04
##  [1] -156002.00       0.64       0.18       0.13       0.05       0.18
##  [7]       0.12       0.80       0.03       0.55       0.04
##  [1] -156043.34       0.64       0.18       0.14       0.05       0.18
##  [7]       0.12       0.80       0.04       0.56       0.04
##  [1] -156093.86       0.63       0.18       0.14       0.05       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156135.71       0.62       0.18       0.14       0.06       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156164.05       0.61       0.18       0.15       0.06       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156179.47       0.60       0.18       0.15       0.07       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] -156184.52       0.59       0.19       0.15       0.07       0.18
##  [7]       0.13       0.79       0.04       0.56       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157324.85       0.52       0.32       0.14       0.02       0.13
##  [7]       0.09       0.89       0.04       0.50       0.05
##  [1] -155979.56       0.55       0.32       0.11       0.02       0.14
##  [7]       0.09       0.89       0.05       0.50       0.04
##  [1] -155946.33       0.56       0.32       0.09       0.03       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] -156007.14       0.56       0.32       0.08       0.03       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] -156064.73       0.57       0.32       0.08       0.04       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] -156103.51       0.57       0.32       0.08       0.04       0.14
##  [7]       0.10       0.89       0.06       0.50       0.04
##  [1] -156123.37       0.57       0.32       0.07       0.04       0.14
##  [7]       0.10       0.89       0.06       0.50       0.04
##  [1] -156127.64       0.56       0.32       0.07       0.05       0.14
##  [7]       0.09       0.89       0.06       0.50       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160447.86       0.60       0.27       0.11       0.02       0.15
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -157444.39       0.64       0.25       0.08       0.03       0.16
##  [7]       0.10       0.84       0.04       0.52       0.05
##  [1] -156810.33       0.65       0.24       0.07       0.04       0.17
##  [7]       0.10       0.82       0.04       0.53       0.04
##  [1] -156576.12       0.65       0.24       0.07       0.04       0.17
##  [7]       0.11       0.80       0.05       0.53       0.04
##  [1] -156520.00       0.65       0.23       0.07       0.05       0.17
##  [7]       0.11       0.79       0.05       0.54       0.04
##  [1] -156549.47       0.64       0.23       0.07       0.06       0.18
##  [7]       0.11       0.78       0.05       0.54       0.04
##  [1] -156613.32       0.63       0.24       0.07       0.06       0.18
##  [7]       0.11       0.77       0.05       0.55       0.04
##  [1] -156683.18       0.63       0.24       0.07       0.07       0.18
##  [7]       0.12       0.76       0.05       0.55       0.04
##  [1] -156744.78       0.62       0.24       0.07       0.07       0.18
##  [7]       0.12       0.76       0.05       0.55       0.04
##  [1] -156792.31       0.61       0.24       0.07       0.07       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] -156824.64       0.60       0.25       0.08       0.08       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] -156842.99       0.59       0.25       0.08       0.08       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] -156849.50       0.58       0.25       0.08       0.08       0.18
##  [7]       0.12       0.75       0.05       0.55       0.04
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159355.88       0.57       0.25       0.15       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -157295.65       0.62       0.23       0.12       0.03       0.16
##  [7]       0.10       0.86       0.05       0.52       0.04
##  [1] -156950.46       0.64       0.22       0.11       0.03       0.17
##  [7]       0.11       0.85       0.06       0.52       0.04
##  [1] -156835.71       0.65       0.21       0.10       0.04       0.17
##  [7]       0.11       0.84       0.06       0.53       0.04
##  [1] -156802.05       0.65       0.21       0.10       0.04       0.17
##  [7]       0.12       0.84       0.07       0.53       0.04
##  [1] -156800.34       0.65       0.20       0.10       0.05       0.17
##  [7]       0.12       0.83       0.07       0.53       0.04
plts_paired_order<-plts_paired[order(sampleinfo_organoid_fetal$passage.or.rescope.no_numeric)]

pdf(here("figs","MTAB4957_fetal_organoids_thresholding_all_samples.pdf"))
plts_paired_order
## [[1]]
## 
## [[2]]
## 
## [[3]]
## 
## [[4]]
## 
## [[5]]
## 
## [[6]]
## 
## [[7]]
## 
## [[8]]
## 
## [[9]]
## 
## [[10]]
## 
## [[11]]
## 
## [[12]]
## 
## [[13]]
## 
## [[14]]
## 
## [[15]]
## 
## [[16]]
## 
## [[17]]
## 
## [[18]]
## 
## [[19]]
## 
## [[20]]
## 
## [[21]]
## 
## [[22]]
## 
## [[23]]
## 
## [[24]]
## 
## [[25]]
## 
## [[26]]
dev.off()
## png 
##   2

Differential methylation with passage not fetal

mod<-model.matrix(~ 0 + passage.or.rescope.no_numeric, data=sampleinfo_organoid_notfetal)
fit <- lmFit(MTAB_organoid_beta_notfetal, mod)
ebfit <- eBayes(fit)

# covariate adjusted beta values
beta<-MTAB_organoid_beta_notfetal

passage_db<-sapply(1:nrow(beta), function(x){
  sampleinfo_cpg<-sampleinfo_organoid_notfetal
  sampleinfo_cpg$beta<-as.numeric(beta[x,])
  
  fit<-lm(beta ~ passage.or.rescope.no_numeric, data=sampleinfo_cpg)
  pval<-summary(fit)$coef["passage.or.rescope.no_numeric","Pr(>|t|)"]
  slope<-fit$coefficients[2]
  
  (min(sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric)*slope) - (max(sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric)*slope)})

passage_MTAB<-data.frame(p.value=ebfit$p.value[,"passage.or.rescope.no_numeric"], CpG=rownames(beta), db=passage_db)

# Adjust P values
passage_MTAB$p_adjusted<-p.adjust(passage_MTAB$p.value, method="BH")

diff_CpG_dbMTAB<-passage_MTAB[which(passage_MTAB$p_adjusted<0.05 & abs(passage_MTAB$db)>0.15),] #25086
diff_CpG_db_hypoMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)>=0.15)] #  17419
diff_CpG_db_hyperMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)<=(-0.15))] #  7667

load original organoid passage CpGs

load(here("data","beta_organoids.RData"))
pvals_long<-read.csv(here("data","Heteroskedactiy_pvalues_FDR_1000iter.csv"), header=T)
pvals_long[,1]<-NULL
colnames(pvals_long)<-c("BP_count","diff_count","mean_db","fdr_BP","fdr_diff")
pvals_long$CpG<-rownames(organoid_beta)
pvals_long$BP_pval<-((1000-pvals_long$BP_count)+1)/1001
pvals_long$diff_pval<-((1000-pvals_long$diff_count)+1)/1001
pvals_long$BP_fdr<-((1000-pvals_long$fdr_BP)+1)/1001
pvals_long$diff_fdr<-((1000-pvals_long$fdr_diff)+1)/1001

hetero_CpG<-rownames(organoid_beta)[which(pvals_long$BP_fdr<0.05)]
print(paste("CpGs with significant (adjusted p<0.05) heteroskedactiy: ", length(hetero_CpG), sep=""))
## [1] "CpGs with significant (adjusted p<0.05) heteroskedactiy: 41852"
diff_CpG<-rownames(organoid_beta)[which(pvals_long$diff_fdr<0.05)]
diff_CpG_db<-pvals_long[which(pvals_long$diff_fdr<0.05 & abs(pvals_long$mean_db)>0.15),]
print(paste("CpGs with significant (adjusted p<0.05; delta beta >0.05) differential methylation: ", nrow(diff_CpG_db), sep=""))
## [1] "CpGs with significant (adjusted p<0.05; delta beta >0.05) differential methylation: 23766"
diff_CpG_db_hypo<-diff_CpG_db$CpG[which((diff_CpG_db$mean_db)>=0.15)] #  11772
diff_CpG_db_hyper<-diff_CpG_db$CpG[which((diff_CpG_db$mean_db)<=(-0.15))] #  5214

How many differential CpGs could overlap? 450K vs EPIC

print(paste("Of the ", nrow(diff_CpG_db), " CpGs differential with passage in the original organoids, ",
            length(diff_CpG_db$CpG[which(diff_CpG_db$CpG%in%rownames(MTAB_organoid_beta_notfetal))]), " are in the 450K data", sep=""))
## [1] "Of the 23766 CpGs differential with passage in the original organoids, 7628 are in the 450K data"
diff_CpG_db_hypo_overlap<-diff_CpG_db_hypo[which(diff_CpG_db_hypo%in%rownames(MTAB_organoid_beta_notfetal))]
diff_CpG_db_hyper_overlap<-diff_CpG_db_hyper[which(diff_CpG_db_hyper%in%rownames(MTAB_organoid_beta_notfetal))]

diff_CpG_db_hypoMTAB_overlap<-diff_CpG_db_hypoMTAB[which(diff_CpG_db_hypoMTAB%in%pvals_long$CpG)]
diff_CpG_db_hyperMTAB_overlap<-diff_CpG_db_hyperMTAB[which(diff_CpG_db_hyperMTAB%in%pvals_long$CpG)]

print(paste("Of the ",length(diff_CpG_db_hypo_overlap)," hypo CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))/length(diff_CpG_db_hypo_overlap))*100,2),"%)",sep=""))
## [1] "Of the 5098 hypo CpGs also on the 450K 3550 are also hypo in the MTAB-4957 cohort (69.64%)"
print(paste("Of the ",length(diff_CpG_db_hyper_overlap)," hypo CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))/length(diff_CpG_db_hyper_overlap))*100,2),"%)",sep=""))
## [1] "Of the 2530 hypo CpGs also on the 450K 1198 are also hypo in the MTAB-4957 cohort (47.35%)"

delta beta directionality plot

plt_db_direction<-merge(pvals_long[,c(3,6)], passage_MTAB, by="CpG")# 380776

plt_db_direction$sig<-"Not Significant"
plt_db_direction$sig[which(plt_db_direction$CpG%in%c(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap),intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap)))]<-"Significant\nIn Both\nCohorts"

ggplot(plt_db_direction, aes(mean_db, db))+geom_point(aes(color=sig, alpha=sig),shape=19)+th+theme_bw()+
  scale_color_manual(values=c("lightgrey", "cornflowerblue"), name="Significant\nWith Passage")+
  scale_alpha_manual(values=c(0.25,1), guide=F)+
  geom_hline(yintercept=c(-0.15,0.15), color="grey60")+geom_vline(xintercept=c(-0.15,0.15), color="grey60")+
  ylim(-0.8,0.8)+xlim(-0.8,0.8)+xlab("Original Organoid\nPassage Delta Beta")+ylab("MTAB-4957 Organoid\nPassage Delta Beta")+
  stat_smooth(method="lm", se=F, color="black")
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_point).

ggsave(here("figs","MTAB_db_directionality.pdf"), width=5, height=3.75)
## Warning: Removed 1 rows containing non-finite values (stat_smooth).

## Warning: Removed 1 rows containing missing values (geom_point).
ggsave(here("figs/jpeg","MTAB_db_directionality.jpeg"), width=5, height=3.75)
## Warning: Removed 1 rows containing non-finite values (stat_smooth).

## Warning: Removed 1 rows containing missing values (geom_point).
print(paste("Correlation of delta betas between cohorts: ", round(cor(plt_db_direction$db, plt_db_direction$mean_db),2), sep=""))
## [1] "Correlation of delta betas between cohorts: 0.53"

representative CpGs

epic.organoid_minimal<-epic.organoid[,c(2, 14, 17)]
colnames(epic.organoid_minimal)[1]<-"Assay.Name"
epic.organoid_minimal$cohort<-"Original Organoids"

sampleinfo_organoid_notfetal_minimal<-sampleinfo_organoid_notfetal[,c(16,22,21)]
sampleinfo_organoid_notfetal_minimal$cohort<-"MTAB-4957 Organoids"

sample_info_both<-rbind(sampleinfo_organoid_notfetal_minimal,epic.organoid_minimal)


plt_hetero_MTAB<-function(CpGs, legend, axislab, title){
  betas<-melt(cbind(MTAB_organoid_beta_notfetal[CpGs,],organoid_beta[CpGs,]))
  organoid_plt<-merge(sample_info_both, betas, by.x="Assay.Name",by.y="Var2")
  
  p<-ggplot(organoid_plt, aes(passage.or.rescope.no_numeric,value))+
    geom_line(aes(group=sample_ID),color="lightgrey")+
    stat_smooth(method="lm", color="grey30", size=0.7, se=F)+th+theme_bw()+
    geom_point(aes(fill=as.factor(passage.or.rescope.no_numeric)),shape=21, size=1.25)+
    scale_fill_manual(values=pass_col,name="Passage\nNumber", drop=T)+
    facet_grid(cohort~Var1)+
    ylab("DNAm Beta")+xlab("Passage Number")+ylim(0,1)+
    theme(plot.margin = margin(0.5, 0.15, 0.5, 0.15, "cm"),plot.title = element_text(size=12))+
    xlim(1,16)
  
  if(missing(legend) & missing(axislab) & missing(title)){p}else{
    if(legend=="N" & axislab=="N"){p + theme(legend.position = "none",axis.title.y=element_blank(),
                                             axis.text.y=element_blank(),
                                             axis.ticks.y=element_blank())+ ggtitle(title)}else{
                                               if(legend=="N" & axislab=="Y"){p + theme(legend.position = "none") + ggtitle(title)}}}}

plt_hetero_MTAB(c("cg25402228","cg09146328"))

ggsave(here("figs","Passage_differential_CpGs_MTAB4957.pdf"),width = 4.75, height = 4)
ggsave(here("figs/jpeg","Passage_differential_CpGs_MTAB4957.jpeg"), width = 4.75, height = 4)

Differential methylation with passage fetal

mod<-model.matrix(~ 0 + passage.or.rescope.no_numeric, data=sampleinfo_organoid_fetal)
fit <- lmFit(MTAB_organoid_beta_fetal, mod)
ebfit <- eBayes(fit)

# covariate adjusted beta values
beta<-MTAB_organoid_beta_fetal

passage_db<-sapply(1:nrow(beta), function(x){
  sampleinfo_cpg<-sampleinfo_organoid_fetal
  sampleinfo_cpg$beta<-as.numeric(beta[x,])
  
  fit<-lm(beta ~ passage.or.rescope.no_numeric, data=sampleinfo_cpg)
  pval<-summary(fit)$coef["passage.or.rescope.no_numeric","Pr(>|t|)"]
  slope<-fit$coefficients[2]
  
  (min(sampleinfo_organoid_fetal$passage.or.rescope.no_numeric)*slope) - (max(sampleinfo_organoid_fetal$passage.or.rescope.no_numeric)*slope)})

passage_MTAB<-data.frame(p.value=ebfit$p.value[,"passage.or.rescope.no_numeric"], CpG=rownames(beta), db=passage_db)

# p adjust
passage_MTAB$p_adjusted<-p.adjust(passage_MTAB$p.value, method="BH")

diff_CpG_dbMTAB<-passage_MTAB[which(passage_MTAB$p_adjusted<0.05 & abs(passage_MTAB$db)>0.15),] #58958
diff_CpG_db_hypoMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)>=0.15)] #  45098
diff_CpG_db_hyperMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)<=(-0.15))] #  13860

How many differential CpGs could overlap? 450K vs EPIC

print(paste("Of the ", nrow(diff_CpG_db), " CpGs differential with passage in the original organoids, ",
            length(diff_CpG_db$CpG[which(diff_CpG_db$CpG%in%rownames(MTAB_organoid_beta_fetal))]), " are in the 450K data", sep=""))
## [1] "Of the 23766 CpGs differential with passage in the original organoids, 7628 are in the 450K data"
diff_CpG_db_hypo_overlap<-diff_CpG_db_hypo[which(diff_CpG_db_hypo%in%rownames(MTAB_organoid_beta_fetal))]
diff_CpG_db_hyper_overlap<-diff_CpG_db_hyper[which(diff_CpG_db_hyper%in%rownames(MTAB_organoid_beta_fetal))]

diff_CpG_db_hypoMTAB_overlap<-diff_CpG_db_hypoMTAB[which(diff_CpG_db_hypoMTAB%in%pvals_long$CpG)]
diff_CpG_db_hyperMTAB_overlap<-diff_CpG_db_hyperMTAB[which(diff_CpG_db_hyperMTAB%in%pvals_long$CpG)]

print(paste("Of the ",length(diff_CpG_db_hypo_overlap)," hypo CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))/length(diff_CpG_db_hypo_overlap))*100,2),"%)",sep=""))
## [1] "Of the 5098 hypo CpGs also on the 450K 3980 are also hypo in the MTAB-4957 cohort (78.07%)"
print(paste("Of the ",length(diff_CpG_db_hyper_overlap)," hypo CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))/length(diff_CpG_db_hyper_overlap))*100,2),"%)",sep=""))
## [1] "Of the 2530 hypo CpGs also on the 450K 845 are also hypo in the MTAB-4957 cohort (33.4%)"
### delta beta directionality plot
plt_db_direction<-merge(pvals_long[,c(3,6)], passage_MTAB, by="CpG")

plt_db_direction$sig<-"Not Significant"
plt_db_direction$sig[which(plt_db_direction$CpG%in%c(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap),intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap)))]<-"Significant\nIn Both\nCohorts"

ggplot(plt_db_direction, aes(mean_db, db))+geom_point(aes(color=sig, alpha=sig),shape=19)+th+theme_bw()+
  scale_color_manual(values=c("lightgrey", "cornflowerblue"), name="Significant\nWith Passage")+
  scale_alpha_manual(values=c(0.25,1), guide=F)+
  geom_hline(yintercept=c(-0.15,0.15), color="grey60")+geom_vline(xintercept=c(-0.15,0.15), color="grey60")+
  ylim(-0.8,0.8)+xlim(-0.8,0.8)+xlab("Original Organoid\nPassage Delta Beta")+ylab("MTAB-4957 Fetal Organoid\nPassage Delta Beta")+
  stat_smooth(method="lm", se=F, color="black")
## Warning: Removed 201 rows containing non-finite values (stat_smooth).
## Warning: Removed 201 rows containing missing values (geom_point).

ggsave(here("figs","MTAB_db_directionality_fetal.pdf"), width=5, height=3.75)
## Warning: Removed 201 rows containing non-finite values (stat_smooth).

## Warning: Removed 201 rows containing missing values (geom_point).
ggsave(here("figs/jpeg","MTAB_db_directionality_fetal.jpeg"), width=5, height=3.75)
## Warning: Removed 201 rows containing non-finite values (stat_smooth).

## Warning: Removed 201 rows containing missing values (geom_point).
print(paste("Correlation of delta betas between cohorts: ", round(cor(plt_db_direction$db, plt_db_direction$mean_db),2), sep=""))
## [1] "Correlation of delta betas between cohorts: 0.5"

representative CpGs

sampleinfo_organoid_fetal_minimal<-sampleinfo_organoid_fetal[,c(16,22,21)]
sampleinfo_organoid_fetal_minimal$cohort<-"MTAB-4957 Fetal Organoids"

sample_info_both<-rbind(sampleinfo_organoid_fetal_minimal,epic.organoid_minimal)

plt_hetero_MTAB<-function(CpGs, legend, axislab, title){
  betas<-melt(cbind(MTAB_organoid_beta_fetal[CpGs,],organoid_beta[CpGs,]))
  organoid_plt<-merge(sample_info_both, betas, by.x="Assay.Name",by.y="Var2")
  
  p<-ggplot(organoid_plt, aes(passage.or.rescope.no_numeric,value))+
    geom_line(aes(group=sample_ID),color="lightgrey")+
    stat_smooth(method="lm", color="grey30", size=0.7, se=F)+th+theme_bw()+
    geom_point(aes(fill=as.factor(passage.or.rescope.no_numeric)),shape=21, size=1.25)+
    scale_fill_manual(values=pass_col,name="Passage\nNumber", drop=T)+
    facet_grid(cohort~Var1)+
    ylab("DNAm Beta")+xlab("Passage Number")+ylim(0,1)+
    theme(plot.margin = margin(0.5, 0.15, 0.5, 0.15, "cm"),plot.title = element_text(size=12))+
    xlim(1,23)
  
  if(missing(legend) & missing(axislab) & missing(title)){p}else{
    if(legend=="N" & axislab=="N"){p + theme(legend.position = "none",axis.title.y=element_blank(),
                                             axis.text.y=element_blank(),
                                             axis.ticks.y=element_blank())+ ggtitle(title)}else{
                                               if(legend=="N" & axislab=="Y"){p + theme(legend.position = "none") + ggtitle(title)}}}}

plt_hetero_MTAB(c("cg25402228","cg09146328"))

ggsave(here("figs","Passage_differential_CpGs_MTAB4957_fetal.pdf"),width = 4.75, height = 4)
ggsave(here("figs/jpeg","Passage_differential_CpGs_MTAB4957_fetal.jpeg"), width = 4.75, height = 4)

R Session Info

sessionInfo()
## R version 3.5.1 (2018-07-02)
## Platform: x86_64-conda_cos6-linux-gnu (64-bit)
## Running under: Red Hat Enterprise Linux
## 
## Matrix products: default
## BLAS/LAPACK: /homes/redgar/anaconda3/envs/org_pass/lib/R/lib/libRblas.so
## 
## locale:
##  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
##  [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
##  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
##  [1] splines   grid      stats4    parallel  stats     graphics  grDevices
##  [8] utils     datasets  methods   base     
## 
## other attached packages:
##  [1] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0 
##  [2] IlluminaHumanMethylation450kmanifest_0.4.0         
##  [3] VGAM_1.1-1                                         
##  [4] limma_3.38.3                                       
##  [5] binom_1.1-1                                        
##  [6] IlluminaHumanMethylationEPICanno.ilm10b4.hg19_0.6.0
##  [7] IlluminaHumanMethylationEPICmanifest_0.3.0         
##  [8] reshape2_1.4.3                                     
##  [9] gridExtra_2.3                                      
## [10] here_0.1                                           
## [11] scales_1.0.0                                       
## [12] rafalib_1.0.0                                      
## [13] RColorBrewer_1.1-2                                 
## [14] ggplot2_3.1.0                                      
## [15] reshape_0.8.8                                      
## [16] minfi_1.28.0                                       
## [17] bumphunter_1.24.5                                  
## [18] locfit_1.5-9.1                                     
## [19] iterators_1.0.10                                   
## [20] foreach_1.4.4                                      
## [21] Biostrings_2.50.1                                  
## [22] XVector_0.22.0                                     
## [23] SummarizedExperiment_1.12.0                        
## [24] DelayedArray_0.8.0                                 
## [25] BiocParallel_1.16.2                                
## [26] matrixStats_0.54.0                                 
## [27] Biobase_2.42.0                                     
## [28] GenomicRanges_1.34.0                               
## [29] GenomeInfoDb_1.18.1                                
## [30] IRanges_2.16.0                                     
## [31] S4Vectors_0.20.1                                   
## [32] BiocGenerics_0.28.0                                
## 
## loaded via a namespace (and not attached):
##  [1] colorspace_1.4-0         siggenes_1.56.0         
##  [3] mclust_5.4.2             rprojroot_1.3-2         
##  [5] base64_2.0               bit64_0.9-7             
##  [7] AnnotationDbi_1.44.0     xml2_1.2.0              
##  [9] codetools_0.2-16         knitr_1.21              
## [11] Rsamtools_1.34.0         annotate_1.60.0         
## [13] HDF5Array_1.10.1         readr_1.3.1             
## [15] compiler_3.5.1           httr_1.4.0              
## [17] backports_1.1.3          assertthat_0.2.0        
## [19] Matrix_1.2-15            lazyeval_0.2.1          
## [21] htmltools_0.3.6          prettyunits_1.0.2       
## [23] tools_3.5.1              gtable_0.2.0            
## [25] glue_1.3.0               GenomeInfoDbData_1.2.0  
## [27] dplyr_0.8.0.1            doRNG_1.7.1             
## [29] Rcpp_1.0.0               multtest_2.38.0         
## [31] preprocessCore_1.44.0    nlme_3.1-137            
## [33] rtracklayer_1.42.2       DelayedMatrixStats_1.4.0
## [35] xfun_0.4                 stringr_1.4.0           
## [37] rngtools_1.3.1           XML_3.98-1.16           
## [39] beanplot_1.2             zlibbioc_1.28.0         
## [41] MASS_7.3-51.1            hms_0.4.2               
## [43] rhdf5_2.26.2             GEOquery_2.50.0         
## [45] yaml_2.2.0               memoise_1.1.0           
## [47] pkgmaker_0.27            biomaRt_2.38.0          
## [49] stringi_1.2.4            RSQLite_2.1.1           
## [51] highr_0.7                genefilter_1.64.0       
## [53] GenomicFeatures_1.34.1   bibtex_0.4.2            
## [55] rlang_0.3.1              pkgconfig_2.0.2         
## [57] bitops_1.0-6             nor1mix_1.2-3           
## [59] evaluate_0.12            lattice_0.20-38         
## [61] purrr_0.2.5              Rhdf5lib_1.4.2          
## [63] GenomicAlignments_1.18.0 labeling_0.3            
## [65] bit_1.1-12               tidyselect_0.2.5        
## [67] plyr_1.8.4               magrittr_1.5            
## [69] R6_2.4.0                 DBI_1.0.0               
## [71] pillar_1.4.3             withr_2.1.2             
## [73] survival_2.43-3          RCurl_1.95-4.11         
## [75] tibble_2.0.1             crayon_1.3.4            
## [77] rmarkdown_1.11           progress_1.2.0          
## [79] data.table_1.12.0        blob_1.1.1              
## [81] digest_0.6.18            xtable_1.8-2            
## [83] tidyr_0.8.2              illuminaio_0.24.0       
## [85] openssl_1.1              munsell_0.5.0           
## [87] registry_0.5             quadprog_1.5-5